Ce que fait ce MCP
Generates and validates Jest or Vitest tests, functional specification files, mocks, and configuration for TypeScript projects.
Outils
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {}, 'description': 'No inputs.', 'additionalProperties': False}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['version', 'anchorHeading', 'files'], 'properties': {'files': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'content', 'audience', 'reads'], 'properties': {'path': {'type': 'string', 'description': 'Target path relative to the project root, e.g. `CLAUDE.md`, `.github/copilot-instructions.md`, `AGENTS.md`, `.github/instructions/3tg.instructions.md`, `.cursor/rules/3tg.mdc`.'}, 'reads': {'type': 'string', 'description': 'Human-readable list of agents that read this path. Useful when reporting to the user which clients will benefit after the write.'}, 'content': {'type': 'string', 'description': 'Markdown body to write. Project-wide entries (audience `claude` / `copilot` / `cross_vendor`) share the same full instruction block. Path-scoped entries (audience ending in `_path_scoped`) carry a shorter routing snippet wrapped with the client-specific frontmatter.'}, 'audience': {'enum': ['claude', 'copilot', 'cross_vendor', 'copilot_path_scoped', 'cursor_path_scoped'], 'type': 'string', 'description': 'Which family of agent reads this file: `claude` = Claude Code / Claude Desktop / Cursor; `copilot` = GitHub Copilot project-wide; `cross_vendor` = AGENTS.md-aware agents (Cursor / Continue / Aider / Codex CLI); `copilot_path_scoped` = Copilot custom-instruction file with `applyTo:` glob frontmatter (auto-loads on 3TG files); `cursor_path_scoped` = Cursor `.mdc` rule with `globs:` frontmatter (auto-attaches on 3TG files).'}}, 'additionalProperties': False}, 'description': 'One entry per canonical agent-instruction file location. Write all five by default; skip individual entries only when the user has explicitly said they use one specific client.'}, 'version': {'type': 'string', 'description': 'Current MCP server version that produced these files. Echoed here so the calling agent knows what version it just installed and can confirm to the user. Every entry in `files` also embeds this version as a single-line HTML comment at the top (`<!-- 3tg-mcp-version: X.Y.Z â\x80¦ -->`), so future agent sessions can grep the stamp and compare against the cheap `3tg://meta/version` resource to detect when their locally-installed instructions are stale.'}, 'anchorHeading': {'type': 'string', 'description': "Markdown heading the agent must grep each existing project-wide target file for before appending. Present â\x86\x92 block is already installed in that file, skip. Absent â\x86\x92 safe to append. Path-scoped entries (audience ending in `_path_scoped`) ignore this and are overwritten verbatim â\x80\x94 they're single-purpose files whose entire content is regenerated by the tool."}}, 'additionalProperties': False}
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['sourceCode', 'fileName', 'functionName', 'clientId'], 'properties': {'clientId': {'type': 'string', 'minLength': 1, 'description': 'The 3tg.dev client ID.'}, 'fileName': {'type': 'string', 'minLength': 1, 'description': "Path of the source file relative to the user's project root."}, 'settings': {'type': 'object', 'properties': {'creationMode': {'type': 'string', 'description': 'Where to write generated test files. Leading "/" = relative to project root with source tree mirrored; otherwise = relative to source file. Empty / "." writes next to the source. Forwarded as 3TG -o.'}, 'mockAsFunction': {'type': 'boolean', 'description': 'Declare mocks as function instead of const (3TG flag -N).'}, 'useAiEnrichment': {'type': 'boolean', 'description': '**Deprecated** â\x80\x94 use `aiEnrichmentMode` instead. Kept for backward compatibility: `true` is treated as `aiEnrichmentMode: "auto"`, `false` is treated as `aiEnrichmentMode: "off"`. If both are set, `aiEnrichmentMode` wins.'}, 'aiEnrichmentMode': {'enum': ['auto', 'client', 'local', 'off'], 'type': 'string', 'description': "Which AI backend to use for enrichment. `auto` (default) tries client sampling first (the MCP client's own LLM via `sampling/createMessage`); if the client doesn't support sampling, or the request fails, falls back to the local LM Studio / Ollama endpoint. `client` = sampling only (fail if unsupported). `local` = local LLM only (ignore sampling). `off` = skip enrichment entirely. Spec-driven tools (`create_tests_from_spec`) ignore this â\x80\x94 the spec is authoritative."}, 'noRuleDefaultTrue': {'type': 'boolean', 'description': "Disable 3TG's default-true test rules (3TG flag -n). Default is **adaptive**: ON when AI enrichment succeeded (so the AI's small, targeted value sets aren't drowned out by 3TG's built-in cartesian explosion of MIN_VALUE / MAX_VALUE / ±Infinity / NaN / â\x80¦ â\x80\x94 those would detach the AI-derived `function-returns` from the generated combinations), OFF when there is no enrichment (legacy v2 scaffold with placeholders). Pass `true` / `false` to force either way."}}, 'description': 'Subset of .3tg/settings.json relevant to this tool.', 'additionalProperties': False}, 'cliConfig': {'type': 'object', 'description': 'Optional per-request 3TG CLI config. The agent assembles this from TWO disk locations and merges them (per-source wins on conflict) before forwarding the merged object as this parameter:\n\n(1) **Global: `.3tg/config.3tg.json`** â\x80\x94 HUMAN-CURATED file with project-wide CLI options (`creationMode`, `mockAsFunction`, `no-rule-default-true`, `rules.<type>.*` defaults, etc.). The agent READS this file on every generation call but **must not autonomously write to it**. Applies to every source. (Explicit user requests to edit it â\x80\x94 "turn off no-rule-default-true", "add a project-wide rules.string.no-empty" â\x80\x94 are authorized edits and should be handled normally.)\n\n(2) **Per-source: `.3tg/<source-path>.md.3tg.json`** â\x80\x94 AGENT-WRITABLE file with per-file CLI options scoped to a single source. Path mirrors the source tree under `.3tg/` (e.g. `src/foo/bar.ts` â\x86\x92 `.3tg/src/foo/bar.md.3tg.json`). The `.md.3tg.json` extension is 3TG\'s convention for config files paired with a `.3tg.md` spec sibling â\x80\x94 the `.md.` infix is what marks the JSON as the partner of the Markdown spec. This is where per-source computed test values live as top-level `mock-parameters` and `function-returns` blocks (BOTH are FLAT maps â\x80\x94 `mock-parameters` is keyed by **parameter name** like `{ "a": [0, 5, -1] }`, and `function-returns` is keyed by full **combination strings** like `"should test double( mock-parameters.a 1, mock-parameters.b 1 )"`. Do NOT nest either under a function-name key â\x80\x94 3TG looks them up at the top level of the cliConfig and silently ignores function-nested values, leaving tests with `__expectedResult: undefined`. See `AGENTS_project.md` § "Preferred workaround when AI enrichment is unavailable" â\x86\x92 "CRITICAL â\x80\x94 the shape 3TG actually expects" for the canonical example.) **When AI enrichment fails and the agent computes values to fill the gap, they go HERE â\x80\x94 not in the global config.** Putting per-source values in the global config would apply the same `mock-parameters.a` to every file in the project that has any function taking an `a` parameter â\x80\x94 almost always wrong. **Flow B caveat â\x80\x94 the spec OWNS test values**: `create_tests_from_spec` regenerates this file from the spec on every call (`-U <spec> -i <config>`), and the MCP **strips** `mock-parameters`, `function-returns`, `expect-values`, `expect-assertions`, `mock-react-hooks`, `mock-async-functions`, `mock-react-contexts`, and `mock-globals` from any `cliConfig` you forward to that tool â\x80\x94 those keys are derived from the spec and forwarding stale values would silently desynchronise test names from value-set sizes via 3TG\'s `-c` later-wins precedence. For Flow B persistence put per-function values in the spec\'s table rows; for Flow B `cliConfig`, forward ONLY global / structural keys (`rules.*`, `creationMode`, `mockAsFunction`, `no-rule-default-true`, `ignore`, `package.json.type`, â\x80¦).\n\nMerge order: read both files (if either exists), shallow-merge with per-source keys winning on conflict, forward the merged object as this parameter. The MCP materialises it inside the sandbox and passes it to 3TG via `-c`. cliConfig keys override AI-enrichment keys on conflict. Omit / pass `undefined` when neither file exists and there\'s nothing computed to send.\n\nSee the "Preferred workaround when AI enrichment is unavailable" section in the project\'s `CLAUDE.md` / `AGENTS.md` / `.github/copilot-instructions.md` for the concrete shape, the three workaround paths (per-source config / edit-after / Flow B), and worked examples.', 'propertyNames': {'type': 'string'}, 'additionalProperties': {}}, 'moduleType': {'enum': ['module', 'commonjs'], 'type': 'string', 'description': 'Optional Node module type of the consumer project â\x80\x94 the value of the `type` field in the project root\'s `package.json`. The agent reads that one field (only) and forwards it here. The MCP injects it into the user-config object as `package.json.type` (3TG\'s CLI config schema has a literal `package.json` key â\x80\x94 see the `3tg://schema/config` resource for the exact shape).\n\n**What 3TG uses this for**: when `module`, 3TG emits imports with explicit `.js` extensions in generated tests (ESM convention â\x80\x94 `import { foo } from \'./foo.js\'`); when `commonjs` (or omitted), 3TG emits bare paths (`import { foo } from \'./foo\'`).\n\n**What the agent should do**: read `package.json` at the project root, extract ONLY the `type` field, and forward it here. If the field is absent, pass `"commonjs"` (Node\'s default) or omit the parameter entirely (same effective result). Do NOT ship the full `package.json` â\x80\x94 private-registry tokens, internal dependency names, scripts, etc. have no place on this wire.'}, 'sourceCode': {'type': 'string', 'maxLength': 500000, 'minLength': 1, 'description': 'Full UTF-8 contents of the source file.'}, 'functionName': {'type': 'string', 'minLength': 1, 'description': 'Name of the exported function to mock. Forwarded as `-f <functionName>`.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['code', 'stdout', 'stderr', 'files'], 'properties': {'code': {'type': 'number', 'description': '3TG CLI exit code (0 on success).'}, 'files': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'content'], 'properties': {'path': {'type': 'string', 'description': 'Project-root-relative write path. `.3tg.md` and `.md.3tg.json` files are returned under the `.3tg/` mirror; tests / mocks travel through unchanged. The agent writes this path verbatim â\x80\x94 do NOT rewrite, rename, or relocate it.'}, 'content': {'type': 'string', 'description': "Full file body to write. UTF-8. Use the agent's native file-write tool to persist this to `path` exactly as returned â\x80\x94 the MCP has already done any path translation, creationMode redirection, and content formatting."}}, 'additionalProperties': False}, 'description': "**Files the agent MUST write to disk after this call returns.** The MCP server is stateless from the editor's perspective â\x80\x94 it returns content only and never touches the user's filesystem. The agent is responsible for iterating this array and writing each entry's `content` to its `path` using the client's native file-write capability. Reporting success without performing the writes leaves the user with no actual output â\x80\x94 the MCP's response is just instructions for the agent's follow-up action."}, 'stderr': {'type': 'string'}, 'stdout': {'type': 'string'}, 'enrichment': {'anyOf': [{'type': 'object', 'required': ['used', 'source', 'modelId', 'durationMs', 'keysProduced'], 'properties': {'used': {'type': 'boolean', 'const': True}, 'source': {'enum': ['client_sampling', 'local_llm'], 'type': 'string', 'description': "Which backend produced the enrichment. `client_sampling` is the MCP client's own LLM via `sampling/createMessage`; `local_llm` is the configured LM Studio / Ollama endpoint."}, 'modelId': {'type': 'string'}, 'durationMs': {'type': 'number'}, 'keysProduced': {'type': 'array', 'items': {'type': 'string'}}}, 'additionalProperties': False}, {'type': 'object', 'required': ['used', 'reason', 'suggestions'], 'properties': {'used': {'type': 'boolean', 'const': False}, 'detail': {'type': 'string'}, 'reason': {'enum': ['opted_out', 'sampling_unavailable', 'sampling_error', 'no_model_id', 'http_error', 'empty_response', 'non_json', 'timeout', 'fetch_failed'], 'type': 'string'}, 'attempted': {'type': 'array', 'items': {'enum': ['client_sampling', 'local_llm'], 'type': 'string'}, 'description': 'Backends that were tried, in order. Lets the client tell the user whether sampling was attempted at all (e.g. on an `auto`-mode call against a sampling-capable client that returned non-JSON, this would be `["client_sampling", "local_llm"]`).'}, 'suggestions': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Server-computed "what to do next" guidance for this failure. Ordered from most-immediately-actionable (typically: have the agent fill in `__expectedResult` values directly by reading the source â\x80\x94 works on every client, no infra changes) to most-involved (enable local LLM fallback, switch clients, use Flow B). Tailored to the failure `reason` AND the server\'s current config â\x80\x94 e.g. the "enable local LLM" suggestion only appears when local LLM is currently disabled. **Agents MUST paraphrase these back to the user** so the failure is actionable.'}}, 'additionalProperties': False}], 'description': 'Diagnostic record describing the AI-enrichment step. `used: true` carries `source` (which backend ran), `modelId`, `durationMs`, and `keysProduced`. `used: false` carries a `reason` (`opted_out` / `sampling_unavailable` / `sampling_error` / `no_model_id` / `http_error` / `empty_response` / `non_json` / `timeout` / `fetch_failed`), an `attempted` list, AND a `suggestions` array of actionable next-steps the agent should surface to the user (e.g. "fill in placeholders yourself", "enable local LLM fallback", "use Flow B"). The suggestions adapt to the server\'s current config â\x80\x94 they\'re not boilerplate.\n\n**Field is OPTIONAL** â\x80\x94 spec-driven tools (`create_tests_from_spec`) omit it entirely because the spec is the authoritative source of expected values; reporting "did AI enrichment succeed?" would be meaningless for a flow that doesn\'t use AI enrichment at all. For Flow A tools (`create_tests`, `create_spec`, etc.), the field is always present.'}}, 'additionalProperties': False}
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['sourceCode', 'fileName', 'clientId'], 'properties': {'clientId': {'type': 'string', 'minLength': 1, 'description': 'The 3tg.dev client ID.'}, 'fileName': {'type': 'string', 'minLength': 1, 'description': 'Path of the source file relative to the user\'s project root (e.g. "src/foo/bar.ts"). The spec is derived as the same path with `.ts` / `.tsx` replaced by `.3tg.md`.'}, 'settings': {'type': 'object', 'properties': {'creationMode': {'type': 'string', 'description': 'Where to write generated test files. Leading "/" = relative to project root with source tree mirrored; otherwise = relative to source file. Empty / "." writes next to the source. Forwarded as 3TG -o.'}, 'mockAsFunction': {'type': 'boolean', 'description': 'Declare mocks as function instead of const (3TG flag -N).'}, 'useAiEnrichment': {'type': 'boolean', 'description': '**Deprecated** â\x80\x94 use `aiEnrichmentMode` instead. Kept for backward compatibility: `true` is treated as `aiEnrichmentMode: "auto"`, `false` is treated as `aiEnrichmentMode: "off"`. If both are set, `aiEnrichmentMode` wins.'}, 'aiEnrichmentMode': {'enum': ['auto', 'client', 'local', 'off'], 'type': 'string', 'description': "Which AI backend to use for enrichment. `auto` (default) tries client sampling first (the MCP client's own LLM via `sampling/createMessage`); if the client doesn't support sampling, or the request fails, falls back to the local LM Studio / Ollama endpoint. `client` = sampling only (fail if unsupported). `local` = local LLM only (ignore sampling). `off` = skip enrichment entirely. Spec-driven tools (`create_tests_from_spec`) ignore this â\x80\x94 the spec is authoritative."}, 'noRuleDefaultTrue': {'type': 'boolean', 'description': "Disable 3TG's default-true test rules (3TG flag -n). Default is **adaptive**: ON when AI enrichment succeeded (so the AI's small, targeted value sets aren't drowned out by 3TG's built-in cartesian explosion of MIN_VALUE / MAX_VALUE / ±Infinity / NaN / â\x80¦ â\x80\x94 those would detach the AI-derived `function-returns` from the generated combinations), OFF when there is no enrichment (legacy v2 scaffold with placeholders). Pass `true` / `false` to force either way."}}, 'description': 'Subset of .3tg/settings.json relevant to this tool.', 'additionalProperties': False}, 'cliConfig': {'type': 'object', 'description': 'Optional per-request 3TG CLI config. The agent assembles this from TWO disk locations and merges them (per-source wins on conflict) before forwarding the merged object as this parameter:\n\n(1) **Global: `.3tg/config.3tg.json`** â\x80\x94 HUMAN-CURATED file with project-wide CLI options (`creationMode`, `mockAsFunction`, `no-rule-default-true`, `rules.<type>.*` defaults, etc.). The agent READS this file on every generation call but **must not autonomously write to it**. Applies to every source. (Explicit user requests to edit it â\x80\x94 "turn off no-rule-default-true", "add a project-wide rules.string.no-empty" â\x80\x94 are authorized edits and should be handled normally.)\n\n(2) **Per-source: `.3tg/<source-path>.md.3tg.json`** â\x80\x94 AGENT-WRITABLE file with per-file CLI options scoped to a single source. Path mirrors the source tree under `.3tg/` (e.g. `src/foo/bar.ts` â\x86\x92 `.3tg/src/foo/bar.md.3tg.json`). The `.md.3tg.json` extension is 3TG\'s convention for config files paired with a `.3tg.md` spec sibling â\x80\x94 the `.md.` infix is what marks the JSON as the partner of the Markdown spec. This is where per-source computed test values live as top-level `mock-parameters` and `function-returns` blocks (BOTH are FLAT maps â\x80\x94 `mock-parameters` is keyed by **parameter name** like `{ "a": [0, 5, -1] }`, and `function-returns` is keyed by full **combination strings** like `"should test double( mock-parameters.a 1, mock-parameters.b 1 )"`. Do NOT nest either under a function-name key â\x80\x94 3TG looks them up at the top level of the cliConfig and silently ignores function-nested values, leaving tests with `__expectedResult: undefined`. See `AGENTS_project.md` § "Preferred workaround when AI enrichment is unavailable" â\x86\x92 "CRITICAL â\x80\x94 the shape 3TG actually expects" for the canonical example.) **When AI enrichment fails and the agent computes values to fill the gap, they go HERE â\x80\x94 not in the global config.** Putting per-source values in the global config would apply the same `mock-parameters.a` to every file in the project that has any function taking an `a` parameter â\x80\x94 almost always wrong. **Flow B caveat â\x80\x94 the spec OWNS test values**: `create_tests_from_spec` regenerates this file from the spec on every call (`-U <spec> -i <config>`), and the MCP **strips** `mock-parameters`, `function-returns`, `expect-values`, `expect-assertions`, `mock-react-hooks`, `mock-async-functions`, `mock-react-contexts`, and `mock-globals` from any `cliConfig` you forward to that tool â\x80\x94 those keys are derived from the spec and forwarding stale values would silently desynchronise test names from value-set sizes via 3TG\'s `-c` later-wins precedence. For Flow B persistence put per-function values in the spec\'s table rows; for Flow B `cliConfig`, forward ONLY global / structural keys (`rules.*`, `creationMode`, `mockAsFunction`, `no-rule-default-true`, `ignore`, `package.json.type`, â\x80¦).\n\nMerge order: read both files (if either exists), shallow-merge with per-source keys winning on conflict, forward the merged object as this parameter. The MCP materialises it inside the sandbox and passes it to 3TG via `-c`. cliConfig keys override AI-enrichment keys on conflict. Omit / pass `undefined` when neither file exists and there\'s nothing computed to send.\n\nSee the "Preferred workaround when AI enrichment is unavailable" section in the project\'s `CLAUDE.md` / `AGENTS.md` / `.github/copilot-instructions.md` for the concrete shape, the three workaround paths (per-source config / edit-after / Flow B), and worked examples.', 'propertyNames': {'type': 'string'}, 'additionalProperties': {}}, 'moduleType': {'enum': ['module', 'commonjs'], 'type': 'string', 'description': 'Optional Node module type of the consumer project â\x80\x94 the value of the `type` field in the project root\'s `package.json`. The agent reads that one field (only) and forwards it here. The MCP injects it into the user-config object as `package.json.type` (3TG\'s CLI config schema has a literal `package.json` key â\x80\x94 see the `3tg://schema/config` resource for the exact shape).\n\n**What 3TG uses this for**: when `module`, 3TG emits imports with explicit `.js` extensions in generated tests (ESM convention â\x80\x94 `import { foo } from \'./foo.js\'`); when `commonjs` (or omitted), 3TG emits bare paths (`import { foo } from \'./foo\'`).\n\n**What the agent should do**: read `package.json` at the project root, extract ONLY the `type` field, and forward it here. If the field is absent, pass `"commonjs"` (Node\'s default) or omit the parameter entirely (same effective result). Do NOT ship the full `package.json` â\x80\x94 private-registry tokens, internal dependency names, scripts, etc. have no place on this wire.'}, 'sourceCode': {'type': 'string', 'maxLength': 500000, 'minLength': 1, 'description': 'Full UTF-8 contents of the source file.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['code', 'stdout', 'stderr', 'files'], 'properties': {'code': {'type': 'number', 'description': '3TG CLI exit code (0 on success).'}, 'files': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'content'], 'properties': {'path': {'type': 'string', 'description': 'Project-root-relative write path. `.3tg.md` and `.md.3tg.json` files are returned under the `.3tg/` mirror; tests / mocks travel through unchanged. The agent writes this path verbatim â\x80\x94 do NOT rewrite, rename, or relocate it.'}, 'content': {'type': 'string', 'description': "Full file body to write. UTF-8. Use the agent's native file-write tool to persist this to `path` exactly as returned â\x80\x94 the MCP has already done any path translation, creationMode redirection, and content formatting."}}, 'additionalProperties': False}, 'description': "**Files the agent MUST write to disk after this call returns.** The MCP server is stateless from the editor's perspective â\x80\x94 it returns content only and never touches the user's filesystem. The agent is responsible for iterating this array and writing each entry's `content` to its `path` using the client's native file-write capability. Reporting success without performing the writes leaves the user with no actual output â\x80\x94 the MCP's response is just instructions for the agent's follow-up action."}, 'stderr': {'type': 'string'}, 'stdout': {'type': 'string'}, 'enrichment': {'anyOf': [{'type': 'object', 'required': ['used', 'source', 'modelId', 'durationMs', 'keysProduced'], 'properties': {'used': {'type': 'boolean', 'const': True}, 'source': {'enum': ['client_sampling', 'local_llm'], 'type': 'string', 'description': "Which backend produced the enrichment. `client_sampling` is the MCP client's own LLM via `sampling/createMessage`; `local_llm` is the configured LM Studio / Ollama endpoint."}, 'modelId': {'type': 'string'}, 'durationMs': {'type': 'number'}, 'keysProduced': {'type': 'array', 'items': {'type': 'string'}}}, 'additionalProperties': False}, {'type': 'object', 'required': ['used', 'reason', 'suggestions'], 'properties': {'used': {'type': 'boolean', 'const': False}, 'detail': {'type': 'string'}, 'reason': {'enum': ['opted_out', 'sampling_unavailable', 'sampling_error', 'no_model_id', 'http_error', 'empty_response', 'non_json', 'timeout', 'fetch_failed'], 'type': 'string'}, 'attempted': {'type': 'array', 'items': {'enum': ['client_sampling', 'local_llm'], 'type': 'string'}, 'description': 'Backends that were tried, in order. Lets the client tell the user whether sampling was attempted at all (e.g. on an `auto`-mode call against a sampling-capable client that returned non-JSON, this would be `["client_sampling", "local_llm"]`).'}, 'suggestions': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Server-computed "what to do next" guidance for this failure. Ordered from most-immediately-actionable (typically: have the agent fill in `__expectedResult` values directly by reading the source â\x80\x94 works on every client, no infra changes) to most-involved (enable local LLM fallback, switch clients, use Flow B). Tailored to the failure `reason` AND the server\'s current config â\x80\x94 e.g. the "enable local LLM" suggestion only appears when local LLM is currently disabled. **Agents MUST paraphrase these back to the user** so the failure is actionable.'}}, 'additionalProperties': False}], 'description': 'Diagnostic record describing the AI-enrichment step. `used: true` carries `source` (which backend ran), `modelId`, `durationMs`, and `keysProduced`. `used: false` carries a `reason` (`opted_out` / `sampling_unavailable` / `sampling_error` / `no_model_id` / `http_error` / `empty_response` / `non_json` / `timeout` / `fetch_failed`), an `attempted` list, AND a `suggestions` array of actionable next-steps the agent should surface to the user (e.g. "fill in placeholders yourself", "enable local LLM fallback", "use Flow B"). The suggestions adapt to the server\'s current config â\x80\x94 they\'re not boilerplate.\n\n**Field is OPTIONAL** â\x80\x94 spec-driven tools (`create_tests_from_spec`) omit it entirely because the spec is the authoritative source of expected values; reporting "did AI enrichment succeed?" would be meaningless for a flow that doesn\'t use AI enrichment at all. For Flow A tools (`create_tests`, `create_spec`, etc.), the field is always present.'}}, 'additionalProperties': False}
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['sourceCode', 'fileName', 'functionName', 'clientId'], 'properties': {'clientId': {'type': 'string', 'minLength': 1, 'description': 'The 3tg.dev client ID.'}, 'fileName': {'type': 'string', 'minLength': 1, 'description': "Path of the source file relative to the user's project root."}, 'settings': {'type': 'object', 'properties': {'creationMode': {'type': 'string', 'description': 'Where to write generated test files. Leading "/" = relative to project root with source tree mirrored; otherwise = relative to source file. Empty / "." writes next to the source. Forwarded as 3TG -o.'}, 'mockAsFunction': {'type': 'boolean', 'description': 'Declare mocks as function instead of const (3TG flag -N).'}, 'useAiEnrichment': {'type': 'boolean', 'description': '**Deprecated** â\x80\x94 use `aiEnrichmentMode` instead. Kept for backward compatibility: `true` is treated as `aiEnrichmentMode: "auto"`, `false` is treated as `aiEnrichmentMode: "off"`. If both are set, `aiEnrichmentMode` wins.'}, 'aiEnrichmentMode': {'enum': ['auto', 'client', 'local', 'off'], 'type': 'string', 'description': "Which AI backend to use for enrichment. `auto` (default) tries client sampling first (the MCP client's own LLM via `sampling/createMessage`); if the client doesn't support sampling, or the request fails, falls back to the local LM Studio / Ollama endpoint. `client` = sampling only (fail if unsupported). `local` = local LLM only (ignore sampling). `off` = skip enrichment entirely. Spec-driven tools (`create_tests_from_spec`) ignore this â\x80\x94 the spec is authoritative."}, 'noRuleDefaultTrue': {'type': 'boolean', 'description': "Disable 3TG's default-true test rules (3TG flag -n). Default is **adaptive**: ON when AI enrichment succeeded (so the AI's small, targeted value sets aren't drowned out by 3TG's built-in cartesian explosion of MIN_VALUE / MAX_VALUE / ±Infinity / NaN / â\x80¦ â\x80\x94 those would detach the AI-derived `function-returns` from the generated combinations), OFF when there is no enrichment (legacy v2 scaffold with placeholders). Pass `true` / `false` to force either way."}}, 'description': 'Subset of .3tg/settings.json relevant to this tool.', 'additionalProperties': False}, 'cliConfig': {'type': 'object', 'description': 'Optional per-request 3TG CLI config. The agent assembles this from TWO disk locations and merges them (per-source wins on conflict) before forwarding the merged object as this parameter:\n\n(1) **Global: `.3tg/config.3tg.json`** â\x80\x94 HUMAN-CURATED file with project-wide CLI options (`creationMode`, `mockAsFunction`, `no-rule-default-true`, `rules.<type>.*` defaults, etc.). The agent READS this file on every generation call but **must not autonomously write to it**. Applies to every source. (Explicit user requests to edit it â\x80\x94 "turn off no-rule-default-true", "add a project-wide rules.string.no-empty" â\x80\x94 are authorized edits and should be handled normally.)\n\n(2) **Per-source: `.3tg/<source-path>.md.3tg.json`** â\x80\x94 AGENT-WRITABLE file with per-file CLI options scoped to a single source. Path mirrors the source tree under `.3tg/` (e.g. `src/foo/bar.ts` â\x86\x92 `.3tg/src/foo/bar.md.3tg.json`). The `.md.3tg.json` extension is 3TG\'s convention for config files paired with a `.3tg.md` spec sibling â\x80\x94 the `.md.` infix is what marks the JSON as the partner of the Markdown spec. This is where per-source computed test values live as top-level `mock-parameters` and `function-returns` blocks (BOTH are FLAT maps â\x80\x94 `mock-parameters` is keyed by **parameter name** like `{ "a": [0, 5, -1] }`, and `function-returns` is keyed by full **combination strings** like `"should test double( mock-parameters.a 1, mock-parameters.b 1 )"`. Do NOT nest either under a function-name key â\x80\x94 3TG looks them up at the top level of the cliConfig and silently ignores function-nested values, leaving tests with `__expectedResult: undefined`. See `AGENTS_project.md` § "Preferred workaround when AI enrichment is unavailable" â\x86\x92 "CRITICAL â\x80\x94 the shape 3TG actually expects" for the canonical example.) **When AI enrichment fails and the agent computes values to fill the gap, they go HERE â\x80\x94 not in the global config.** Putting per-source values in the global config would apply the same `mock-parameters.a` to every file in the project that has any function taking an `a` parameter â\x80\x94 almost always wrong. **Flow B caveat â\x80\x94 the spec OWNS test values**: `create_tests_from_spec` regenerates this file from the spec on every call (`-U <spec> -i <config>`), and the MCP **strips** `mock-parameters`, `function-returns`, `expect-values`, `expect-assertions`, `mock-react-hooks`, `mock-async-functions`, `mock-react-contexts`, and `mock-globals` from any `cliConfig` you forward to that tool â\x80\x94 those keys are derived from the spec and forwarding stale values would silently desynchronise test names from value-set sizes via 3TG\'s `-c` later-wins precedence. For Flow B persistence put per-function values in the spec\'s table rows; for Flow B `cliConfig`, forward ONLY global / structural keys (`rules.*`, `creationMode`, `mockAsFunction`, `no-rule-default-true`, `ignore`, `package.json.type`, â\x80¦).\n\nMerge order: read both files (if either exists), shallow-merge with per-source keys winning on conflict, forward the merged object as this parameter. The MCP materialises it inside the sandbox and passes it to 3TG via `-c`. cliConfig keys override AI-enrichment keys on conflict. Omit / pass `undefined` when neither file exists and there\'s nothing computed to send.\n\nSee the "Preferred workaround when AI enrichment is unavailable" section in the project\'s `CLAUDE.md` / `AGENTS.md` / `.github/copilot-instructions.md` for the concrete shape, the three workaround paths (per-source config / edit-after / Flow B), and worked examples.', 'propertyNames': {'type': 'string'}, 'additionalProperties': {}}, 'moduleType': {'enum': ['module', 'commonjs'], 'type': 'string', 'description': 'Optional Node module type of the consumer project â\x80\x94 the value of the `type` field in the project root\'s `package.json`. The agent reads that one field (only) and forwards it here. The MCP injects it into the user-config object as `package.json.type` (3TG\'s CLI config schema has a literal `package.json` key â\x80\x94 see the `3tg://schema/config` resource for the exact shape).\n\n**What 3TG uses this for**: when `module`, 3TG emits imports with explicit `.js` extensions in generated tests (ESM convention â\x80\x94 `import { foo } from \'./foo.js\'`); when `commonjs` (or omitted), 3TG emits bare paths (`import { foo } from \'./foo\'`).\n\n**What the agent should do**: read `package.json` at the project root, extract ONLY the `type` field, and forward it here. If the field is absent, pass `"commonjs"` (Node\'s default) or omit the parameter entirely (same effective result). Do NOT ship the full `package.json` â\x80\x94 private-registry tokens, internal dependency names, scripts, etc. have no place on this wire.'}, 'sourceCode': {'type': 'string', 'maxLength': 500000, 'minLength': 1, 'description': 'Full UTF-8 contents of the source file.'}, 'functionName': {'type': 'string', 'minLength': 1, 'description': 'Name of the exported function or React component to scope the spec to. Forwarded to 3TG as `-f <functionName>`. Use `default` for default exports.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['code', 'stdout', 'stderr', 'files'], 'properties': {'code': {'type': 'number', 'description': '3TG CLI exit code (0 on success).'}, 'files': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'content'], 'properties': {'path': {'type': 'string', 'description': 'Project-root-relative write path. `.3tg.md` and `.md.3tg.json` files are returned under the `.3tg/` mirror; tests / mocks travel through unchanged. The agent writes this path verbatim â\x80\x94 do NOT rewrite, rename, or relocate it.'}, 'content': {'type': 'string', 'description': "Full file body to write. UTF-8. Use the agent's native file-write tool to persist this to `path` exactly as returned â\x80\x94 the MCP has already done any path translation, creationMode redirection, and content formatting."}}, 'additionalProperties': False}, 'description': "**Files the agent MUST write to disk after this call returns.** The MCP server is stateless from the editor's perspective â\x80\x94 it returns content only and never touches the user's filesystem. The agent is responsible for iterating this array and writing each entry's `content` to its `path` using the client's native file-write capability. Reporting success without performing the writes leaves the user with no actual output â\x80\x94 the MCP's response is just instructions for the agent's follow-up action."}, 'stderr': {'type': 'string'}, 'stdout': {'type': 'string'}, 'enrichment': {'anyOf': [{'type': 'object', 'required': ['used', 'source', 'modelId', 'durationMs', 'keysProduced'], 'properties': {'used': {'type': 'boolean', 'const': True}, 'source': {'enum': ['client_sampling', 'local_llm'], 'type': 'string', 'description': "Which backend produced the enrichment. `client_sampling` is the MCP client's own LLM via `sampling/createMessage`; `local_llm` is the configured LM Studio / Ollama endpoint."}, 'modelId': {'type': 'string'}, 'durationMs': {'type': 'number'}, 'keysProduced': {'type': 'array', 'items': {'type': 'string'}}}, 'additionalProperties': False}, {'type': 'object', 'required': ['used', 'reason', 'suggestions'], 'properties': {'used': {'type': 'boolean', 'const': False}, 'detail': {'type': 'string'}, 'reason': {'enum': ['opted_out', 'sampling_unavailable', 'sampling_error', 'no_model_id', 'http_error', 'empty_response', 'non_json', 'timeout', 'fetch_failed'], 'type': 'string'}, 'attempted': {'type': 'array', 'items': {'enum': ['client_sampling', 'local_llm'], 'type': 'string'}, 'description': 'Backends that were tried, in order. Lets the client tell the user whether sampling was attempted at all (e.g. on an `auto`-mode call against a sampling-capable client that returned non-JSON, this would be `["client_sampling", "local_llm"]`).'}, 'suggestions': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Server-computed "what to do next" guidance for this failure. Ordered from most-immediately-actionable (typically: have the agent fill in `__expectedResult` values directly by reading the source â\x80\x94 works on every client, no infra changes) to most-involved (enable local LLM fallback, switch clients, use Flow B). Tailored to the failure `reason` AND the server\'s current config â\x80\x94 e.g. the "enable local LLM" suggestion only appears when local LLM is currently disabled. **Agents MUST paraphrase these back to the user** so the failure is actionable.'}}, 'additionalProperties': False}], 'description': 'Diagnostic record describing the AI-enrichment step. `used: true` carries `source` (which backend ran), `modelId`, `durationMs`, and `keysProduced`. `used: false` carries a `reason` (`opted_out` / `sampling_unavailable` / `sampling_error` / `no_model_id` / `http_error` / `empty_response` / `non_json` / `timeout` / `fetch_failed`), an `attempted` list, AND a `suggestions` array of actionable next-steps the agent should surface to the user (e.g. "fill in placeholders yourself", "enable local LLM fallback", "use Flow B"). The suggestions adapt to the server\'s current config â\x80\x94 they\'re not boilerplate.\n\n**Field is OPTIONAL** â\x80\x94 spec-driven tools (`create_tests_from_spec`) omit it entirely because the spec is the authoritative source of expected values; reporting "did AI enrichment succeed?" would be meaningless for a flow that doesn\'t use AI enrichment at all. For Flow A tools (`create_tests`, `create_spec`, etc.), the field is always present.'}}, 'additionalProperties': False}
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['sourceCode', 'fileName', 'clientId'], 'properties': {'clientId': {'type': 'string', 'minLength': 1, 'description': 'The 3tg.dev client ID â\x80\x94 sent as authentication to license-api for quota verification before generation and quota consumption / KPI recording after a successful run.'}, 'fileName': {'type': 'string', 'minLength': 1, 'description': 'Path of the source file relative to the user\'s project root, e.g. "src/foo/bar.ts". Used as both the 3TG positional argument and the sandbox-side location.'}, 'settings': {'type': 'object', 'properties': {'creationMode': {'type': 'string', 'description': 'Where to write generated test files. Leading "/" = relative to project root with source tree mirrored; otherwise = relative to source file. Empty / "." writes next to the source. Forwarded as 3TG -o.'}, 'mockAsFunction': {'type': 'boolean', 'description': 'Declare mocks as function instead of const (3TG flag -N).'}, 'useAiEnrichment': {'type': 'boolean', 'description': '**Deprecated** â\x80\x94 use `aiEnrichmentMode` instead. Kept for backward compatibility: `true` is treated as `aiEnrichmentMode: "auto"`, `false` is treated as `aiEnrichmentMode: "off"`. If both are set, `aiEnrichmentMode` wins.'}, 'aiEnrichmentMode': {'enum': ['auto', 'client', 'local', 'off'], 'type': 'string', 'description': "Which AI backend to use for enrichment. `auto` (default) tries client sampling first (the MCP client's own LLM via `sampling/createMessage`); if the client doesn't support sampling, or the request fails, falls back to the local LM Studio / Ollama endpoint. `client` = sampling only (fail if unsupported). `local` = local LLM only (ignore sampling). `off` = skip enrichment entirely. Spec-driven tools (`create_tests_from_spec`) ignore this â\x80\x94 the spec is authoritative."}, 'noRuleDefaultTrue': {'type': 'boolean', 'description': "Disable 3TG's default-true test rules (3TG flag -n). Default is **adaptive**: ON when AI enrichment succeeded (so the AI's small, targeted value sets aren't drowned out by 3TG's built-in cartesian explosion of MIN_VALUE / MAX_VALUE / ±Infinity / NaN / â\x80¦ â\x80\x94 those would detach the AI-derived `function-returns` from the generated combinations), OFF when there is no enrichment (legacy v2 scaffold with placeholders). Pass `true` / `false` to force either way."}}, 'description': 'Subset of .3tg/settings.json relevant to this tool.', 'additionalProperties': False}, 'cliConfig': {'type': 'object', 'description': 'Optional per-request 3TG CLI config. The agent assembles this from TWO disk locations and merges them (per-source wins on conflict) before forwarding the merged object as this parameter:\n\n(1) **Global: `.3tg/config.3tg.json`** â\x80\x94 HUMAN-CURATED file with project-wide CLI options (`creationMode`, `mockAsFunction`, `no-rule-default-true`, `rules.<type>.*` defaults, etc.). The agent READS this file on every generation call but **must not autonomously write to it**. Applies to every source. (Explicit user requests to edit it â\x80\x94 "turn off no-rule-default-true", "add a project-wide rules.string.no-empty" â\x80\x94 are authorized edits and should be handled normally.)\n\n(2) **Per-source: `.3tg/<source-path>.md.3tg.json`** â\x80\x94 AGENT-WRITABLE file with per-file CLI options scoped to a single source. Path mirrors the source tree under `.3tg/` (e.g. `src/foo/bar.ts` â\x86\x92 `.3tg/src/foo/bar.md.3tg.json`). The `.md.3tg.json` extension is 3TG\'s convention for config files paired with a `.3tg.md` spec sibling â\x80\x94 the `.md.` infix is what marks the JSON as the partner of the Markdown spec. This is where per-source computed test values live as top-level `mock-parameters` and `function-returns` blocks (BOTH are FLAT maps â\x80\x94 `mock-parameters` is keyed by **parameter name** like `{ "a": [0, 5, -1] }`, and `function-returns` is keyed by full **combination strings** like `"should test double( mock-parameters.a 1, mock-parameters.b 1 )"`. Do NOT nest either under a function-name key â\x80\x94 3TG looks them up at the top level of the cliConfig and silently ignores function-nested values, leaving tests with `__expectedResult: undefined`. See `AGENTS_project.md` § "Preferred workaround when AI enrichment is unavailable" â\x86\x92 "CRITICAL â\x80\x94 the shape 3TG actually expects" for the canonical example.) **When AI enrichment fails and the agent computes values to fill the gap, they go HERE â\x80\x94 not in the global config.** Putting per-source values in the global config would apply the same `mock-parameters.a` to every file in the project that has any function taking an `a` parameter â\x80\x94 almost always wrong. **Flow B caveat â\x80\x94 the spec OWNS test values**: `create_tests_from_spec` regenerates this file from the spec on every call (`-U <spec> -i <config>`), and the MCP **strips** `mock-parameters`, `function-returns`, `expect-values`, `expect-assertions`, `mock-react-hooks`, `mock-async-functions`, `mock-react-contexts`, and `mock-globals` from any `cliConfig` you forward to that tool â\x80\x94 those keys are derived from the spec and forwarding stale values would silently desynchronise test names from value-set sizes via 3TG\'s `-c` later-wins precedence. For Flow B persistence put per-function values in the spec\'s table rows; for Flow B `cliConfig`, forward ONLY global / structural keys (`rules.*`, `creationMode`, `mockAsFunction`, `no-rule-default-true`, `ignore`, `package.json.type`, â\x80¦).\n\nMerge order: read both files (if either exists), shallow-merge with per-source keys winning on conflict, forward the merged object as this parameter. The MCP materialises it inside the sandbox and passes it to 3TG via `-c`. cliConfig keys override AI-enrichment keys on conflict. Omit / pass `undefined` when neither file exists and there\'s nothing computed to send.\n\nSee the "Preferred workaround when AI enrichment is unavailable" section in the project\'s `CLAUDE.md` / `AGENTS.md` / `.github/copilot-instructions.md` for the concrete shape, the three workaround paths (per-source config / edit-after / Flow B), and worked examples.', 'propertyNames': {'type': 'string'}, 'additionalProperties': {}}, 'moduleType': {'enum': ['module', 'commonjs'], 'type': 'string', 'description': 'Optional Node module type of the consumer project â\x80\x94 the value of the `type` field in the project root\'s `package.json`. The agent reads that one field (only) and forwards it here. The MCP injects it into the user-config object as `package.json.type` (3TG\'s CLI config schema has a literal `package.json` key â\x80\x94 see the `3tg://schema/config` resource for the exact shape).\n\n**What 3TG uses this for**: when `module`, 3TG emits imports with explicit `.js` extensions in generated tests (ESM convention â\x80\x94 `import { foo } from \'./foo.js\'`); when `commonjs` (or omitted), 3TG emits bare paths (`import { foo } from \'./foo\'`).\n\n**What the agent should do**: read `package.json` at the project root, extract ONLY the `type` field, and forward it here. If the field is absent, pass `"commonjs"` (Node\'s default) or omit the parameter entirely (same effective result). Do NOT ship the full `package.json` â\x80\x94 private-registry tokens, internal dependency names, scripts, etc. have no place on this wire.'}, 'sourceCode': {'type': 'string', 'maxLength': 500000, 'minLength': 1, 'description': 'Full UTF-8 contents of the source file.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['code', 'stdout', 'stderr', 'files'], 'properties': {'code': {'type': 'number', 'description': '3TG CLI exit code (0 on success).'}, 'files': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'content'], 'properties': {'path': {'type': 'string', 'description': 'Project-root-relative write path. `.3tg.md` and `.md.3tg.json` files are returned under the `.3tg/` mirror; tests / mocks travel through unchanged. The agent writes this path verbatim â\x80\x94 do NOT rewrite, rename, or relocate it.'}, 'content': {'type': 'string', 'description': "Full file body to write. UTF-8. Use the agent's native file-write tool to persist this to `path` exactly as returned â\x80\x94 the MCP has already done any path translation, creationMode redirection, and content formatting."}}, 'additionalProperties': False}, 'description': "**Files the agent MUST write to disk after this call returns.** The MCP server is stateless from the editor's perspective â\x80\x94 it returns content only and never touches the user's filesystem. The agent is responsible for iterating this array and writing each entry's `content` to its `path` using the client's native file-write capability. Reporting success without performing the writes leaves the user with no actual output â\x80\x94 the MCP's response is just instructions for the agent's follow-up action."}, 'stderr': {'type': 'string'}, 'stdout': {'type': 'string'}, 'enrichment': {'anyOf': [{'type': 'object', 'required': ['used', 'source', 'modelId', 'durationMs', 'keysProduced'], 'properties': {'used': {'type': 'boolean', 'const': True}, 'source': {'enum': ['client_sampling', 'local_llm'], 'type': 'string', 'description': "Which backend produced the enrichment. `client_sampling` is the MCP client's own LLM via `sampling/createMessage`; `local_llm` is the configured LM Studio / Ollama endpoint."}, 'modelId': {'type': 'string'}, 'durationMs': {'type': 'number'}, 'keysProduced': {'type': 'array', 'items': {'type': 'string'}}}, 'additionalProperties': False}, {'type': 'object', 'required': ['used', 'reason', 'suggestions'], 'properties': {'used': {'type': 'boolean', 'const': False}, 'detail': {'type': 'string'}, 'reason': {'enum': ['opted_out', 'sampling_unavailable', 'sampling_error', 'no_model_id', 'http_error', 'empty_response', 'non_json', 'timeout', 'fetch_failed'], 'type': 'string'}, 'attempted': {'type': 'array', 'items': {'enum': ['client_sampling', 'local_llm'], 'type': 'string'}, 'description': 'Backends that were tried, in order. Lets the client tell the user whether sampling was attempted at all (e.g. on an `auto`-mode call against a sampling-capable client that returned non-JSON, this would be `["client_sampling", "local_llm"]`).'}, 'suggestions': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Server-computed "what to do next" guidance for this failure. Ordered from most-immediately-actionable (typically: have the agent fill in `__expectedResult` values directly by reading the source â\x80\x94 works on every client, no infra changes) to most-involved (enable local LLM fallback, switch clients, use Flow B). Tailored to the failure `reason` AND the server\'s current config â\x80\x94 e.g. the "enable local LLM" suggestion only appears when local LLM is currently disabled. **Agents MUST paraphrase these back to the user** so the failure is actionable.'}}, 'additionalProperties': False}], 'description': 'Diagnostic record describing the AI-enrichment step. `used: true` carries `source` (which backend ran), `modelId`, `durationMs`, and `keysProduced`. `used: false` carries a `reason` (`opted_out` / `sampling_unavailable` / `sampling_error` / `no_model_id` / `http_error` / `empty_response` / `non_json` / `timeout` / `fetch_failed`), an `attempted` list, AND a `suggestions` array of actionable next-steps the agent should surface to the user (e.g. "fill in placeholders yourself", "enable local LLM fallback", "use Flow B"). The suggestions adapt to the server\'s current config â\x80\x94 they\'re not boilerplate.\n\n**Field is OPTIONAL** â\x80\x94 spec-driven tools (`create_tests_from_spec`) omit it entirely because the spec is the authoritative source of expected values; reporting "did AI enrichment succeed?" would be meaningless for a flow that doesn\'t use AI enrichment at all. For Flow A tools (`create_tests`, `create_spec`, etc.), the field is always present.'}}, 'additionalProperties': False}
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['sourceCode', 'specContent', 'fileName', 'clientId'], 'properties': {'clientId': {'type': 'string', 'minLength': 1, 'description': 'The 3tg.dev client ID.'}, 'fileName': {'type': 'string', 'minLength': 1, 'description': 'Path of the source file relative to the user\'s project root (e.g. "src/foo/bar.ts"). The spec filename is derived as the same path with `.ts` / `.tsx` replaced by `.3tg.md`.'}, 'settings': {'type': 'object', 'properties': {'creationMode': {'type': 'string', 'description': 'Where to write generated test files. Leading "/" = relative to project root with source tree mirrored; otherwise = relative to source file. Empty / "." writes next to the source. Forwarded as 3TG -o.'}, 'mockAsFunction': {'type': 'boolean', 'description': 'Declare mocks as function instead of const (3TG flag -N).'}, 'useAiEnrichment': {'type': 'boolean', 'description': '**Deprecated** â\x80\x94 use `aiEnrichmentMode` instead. Kept for backward compatibility: `true` is treated as `aiEnrichmentMode: "auto"`, `false` is treated as `aiEnrichmentMode: "off"`. If both are set, `aiEnrichmentMode` wins.'}, 'aiEnrichmentMode': {'enum': ['auto', 'client', 'local', 'off'], 'type': 'string', 'description': "Which AI backend to use for enrichment. `auto` (default) tries client sampling first (the MCP client's own LLM via `sampling/createMessage`); if the client doesn't support sampling, or the request fails, falls back to the local LM Studio / Ollama endpoint. `client` = sampling only (fail if unsupported). `local` = local LLM only (ignore sampling). `off` = skip enrichment entirely. Spec-driven tools (`create_tests_from_spec`) ignore this â\x80\x94 the spec is authoritative."}, 'noRuleDefaultTrue': {'type': 'boolean', 'description': "Disable 3TG's default-true test rules (3TG flag -n). Default is **adaptive**: ON when AI enrichment succeeded (so the AI's small, targeted value sets aren't drowned out by 3TG's built-in cartesian explosion of MIN_VALUE / MAX_VALUE / ±Infinity / NaN / â\x80¦ â\x80\x94 those would detach the AI-derived `function-returns` from the generated combinations), OFF when there is no enrichment (legacy v2 scaffold with placeholders). Pass `true` / `false` to force either way."}}, 'description': 'Subset of .3tg/settings.json relevant to this tool.', 'additionalProperties': False}, 'cliConfig': {'type': 'object', 'description': 'Optional per-request 3TG CLI config. The agent assembles this from TWO disk locations and merges them (per-source wins on conflict) before forwarding the merged object as this parameter:\n\n(1) **Global: `.3tg/config.3tg.json`** â\x80\x94 HUMAN-CURATED file with project-wide CLI options (`creationMode`, `mockAsFunction`, `no-rule-default-true`, `rules.<type>.*` defaults, etc.). The agent READS this file on every generation call but **must not autonomously write to it**. Applies to every source. (Explicit user requests to edit it â\x80\x94 "turn off no-rule-default-true", "add a project-wide rules.string.no-empty" â\x80\x94 are authorized edits and should be handled normally.)\n\n(2) **Per-source: `.3tg/<source-path>.md.3tg.json`** â\x80\x94 AGENT-WRITABLE file with per-file CLI options scoped to a single source. Path mirrors the source tree under `.3tg/` (e.g. `src/foo/bar.ts` â\x86\x92 `.3tg/src/foo/bar.md.3tg.json`). The `.md.3tg.json` extension is 3TG\'s convention for config files paired with a `.3tg.md` spec sibling â\x80\x94 the `.md.` infix is what marks the JSON as the partner of the Markdown spec. This is where per-source computed test values live as top-level `mock-parameters` and `function-returns` blocks (BOTH are FLAT maps â\x80\x94 `mock-parameters` is keyed by **parameter name** like `{ "a": [0, 5, -1] }`, and `function-returns` is keyed by full **combination strings** like `"should test double( mock-parameters.a 1, mock-parameters.b 1 )"`. Do NOT nest either under a function-name key â\x80\x94 3TG looks them up at the top level of the cliConfig and silently ignores function-nested values, leaving tests with `__expectedResult: undefined`. See `AGENTS_project.md` § "Preferred workaround when AI enrichment is unavailable" â\x86\x92 "CRITICAL â\x80\x94 the shape 3TG actually expects" for the canonical example.) **When AI enrichment fails and the agent computes values to fill the gap, they go HERE â\x80\x94 not in the global config.** Putting per-source values in the global config would apply the same `mock-parameters.a` to every file in the project that has any function taking an `a` parameter â\x80\x94 almost always wrong. **Flow B caveat â\x80\x94 the spec OWNS test values**: `create_tests_from_spec` regenerates this file from the spec on every call (`-U <spec> -i <config>`), and the MCP **strips** `mock-parameters`, `function-returns`, `expect-values`, `expect-assertions`, `mock-react-hooks`, `mock-async-functions`, `mock-react-contexts`, and `mock-globals` from any `cliConfig` you forward to that tool â\x80\x94 those keys are derived from the spec and forwarding stale values would silently desynchronise test names from value-set sizes via 3TG\'s `-c` later-wins precedence. For Flow B persistence put per-function values in the spec\'s table rows; for Flow B `cliConfig`, forward ONLY global / structural keys (`rules.*`, `creationMode`, `mockAsFunction`, `no-rule-default-true`, `ignore`, `package.json.type`, â\x80¦).\n\nMerge order: read both files (if either exists), shallow-merge with per-source keys winning on conflict, forward the merged object as this parameter. The MCP materialises it inside the sandbox and passes it to 3TG via `-c`. cliConfig keys override AI-enrichment keys on conflict. Omit / pass `undefined` when neither file exists and there\'s nothing computed to send.\n\nSee the "Preferred workaround when AI enrichment is unavailable" section in the project\'s `CLAUDE.md` / `AGENTS.md` / `.github/copilot-instructions.md` for the concrete shape, the three workaround paths (per-source config / edit-after / Flow B), and worked examples.', 'propertyNames': {'type': 'string'}, 'additionalProperties': {}}, 'moduleType': {'enum': ['module', 'commonjs'], 'type': 'string', 'description': 'Optional Node module type of the consumer project â\x80\x94 the value of the `type` field in the project root\'s `package.json`. The agent reads that one field (only) and forwards it here. The MCP injects it into the user-config object as `package.json.type` (3TG\'s CLI config schema has a literal `package.json` key â\x80\x94 see the `3tg://schema/config` resource for the exact shape).\n\n**What 3TG uses this for**: when `module`, 3TG emits imports with explicit `.js` extensions in generated tests (ESM convention â\x80\x94 `import { foo } from \'./foo.js\'`); when `commonjs` (or omitted), 3TG emits bare paths (`import { foo } from \'./foo\'`).\n\n**What the agent should do**: read `package.json` at the project root, extract ONLY the `type` field, and forward it here. If the field is absent, pass `"commonjs"` (Node\'s default) or omit the parameter entirely (same effective result). Do NOT ship the full `package.json` â\x80\x94 private-registry tokens, internal dependency names, scripts, etc. have no place on this wire.'}, 'sourceCode': {'type': 'string', 'maxLength': 500000, 'minLength': 1, 'description': 'Full UTF-8 contents of the source file.'}, 'specContent': {'type': 'string', 'maxLength': 50000, 'minLength': 1, 'description': 'Full UTF-8 contents of the `.3tg.md` spec â\x80\x94 as the user has edited it locally under `.3tg/<sourceDir>/<basename>.3tg.md`.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['code', 'stdout', 'stderr', 'files'], 'properties': {'code': {'type': 'number', 'description': '3TG CLI exit code (0 on success).'}, 'files': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'content'], 'properties': {'path': {'type': 'string', 'description': 'Project-root-relative write path. `.3tg.md` and `.md.3tg.json` files are returned under the `.3tg/` mirror; tests / mocks travel through unchanged. The agent writes this path verbatim â\x80\x94 do NOT rewrite, rename, or relocate it.'}, 'content': {'type': 'string', 'description': "Full file body to write. UTF-8. Use the agent's native file-write tool to persist this to `path` exactly as returned â\x80\x94 the MCP has already done any path translation, creationMode redirection, and content formatting."}}, 'additionalProperties': False}, 'description': "**Files the agent MUST write to disk after this call returns.** The MCP server is stateless from the editor's perspective â\x80\x94 it returns content only and never touches the user's filesystem. The agent is responsible for iterating this array and writing each entry's `content` to its `path` using the client's native file-write capability. Reporting success without performing the writes leaves the user with no actual output â\x80\x94 the MCP's response is just instructions for the agent's follow-up action."}, 'stderr': {'type': 'string'}, 'stdout': {'type': 'string'}, 'enrichment': {'anyOf': [{'type': 'object', 'required': ['used', 'source', 'modelId', 'durationMs', 'keysProduced'], 'properties': {'used': {'type': 'boolean', 'const': True}, 'source': {'enum': ['client_sampling', 'local_llm'], 'type': 'string', 'description': "Which backend produced the enrichment. `client_sampling` is the MCP client's own LLM via `sampling/createMessage`; `local_llm` is the configured LM Studio / Ollama endpoint."}, 'modelId': {'type': 'string'}, 'durationMs': {'type': 'number'}, 'keysProduced': {'type': 'array', 'items': {'type': 'string'}}}, 'additionalProperties': False}, {'type': 'object', 'required': ['used', 'reason', 'suggestions'], 'properties': {'used': {'type': 'boolean', 'const': False}, 'detail': {'type': 'string'}, 'reason': {'enum': ['opted_out', 'sampling_unavailable', 'sampling_error', 'no_model_id', 'http_error', 'empty_response', 'non_json', 'timeout', 'fetch_failed'], 'type': 'string'}, 'attempted': {'type': 'array', 'items': {'enum': ['client_sampling', 'local_llm'], 'type': 'string'}, 'description': 'Backends that were tried, in order. Lets the client tell the user whether sampling was attempted at all (e.g. on an `auto`-mode call against a sampling-capable client that returned non-JSON, this would be `["client_sampling", "local_llm"]`).'}, 'suggestions': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Server-computed "what to do next" guidance for this failure. Ordered from most-immediately-actionable (typically: have the agent fill in `__expectedResult` values directly by reading the source â\x80\x94 works on every client, no infra changes) to most-involved (enable local LLM fallback, switch clients, use Flow B). Tailored to the failure `reason` AND the server\'s current config â\x80\x94 e.g. the "enable local LLM" suggestion only appears when local LLM is currently disabled. **Agents MUST paraphrase these back to the user** so the failure is actionable.'}}, 'additionalProperties': False}], 'description': 'Diagnostic record describing the AI-enrichment step. `used: true` carries `source` (which backend ran), `modelId`, `durationMs`, and `keysProduced`. `used: false` carries a `reason` (`opted_out` / `sampling_unavailable` / `sampling_error` / `no_model_id` / `http_error` / `empty_response` / `non_json` / `timeout` / `fetch_failed`), an `attempted` list, AND a `suggestions` array of actionable next-steps the agent should surface to the user (e.g. "fill in placeholders yourself", "enable local LLM fallback", "use Flow B"). The suggestions adapt to the server\'s current config â\x80\x94 they\'re not boilerplate.\n\n**Field is OPTIONAL** â\x80\x94 spec-driven tools (`create_tests_from_spec`) omit it entirely because the spec is the authoritative source of expected values; reporting "did AI enrichment succeed?" would be meaningless for a flow that doesn\'t use AI enrichment at all. For Flow A tools (`create_tests`, `create_spec`, etc.), the field is always present.'}}, 'additionalProperties': False}
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['clientId'], 'properties': {'clientId': {'type': 'string', 'maxLength': 256, 'minLength': 1, 'description': 'The 3tg.dev clientId to inspect.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['clientId', 'planName', 'available', 'total', 'recurring', 'recurringRemaining', 'startOfPeriod', 'endOfPeriod', 'exhausted'], 'properties': {'total': {'type': 'number', 'description': 'Lifetime allocation (recurring + boosters since signup). Same unit as `available` â\x80\x94 number of test cases.'}, 'clientId': {'type': 'string', 'description': 'Echo of the input for round-trip clarity.'}, 'planName': {'type': 'string', 'description': 'Human-readable plan name derived from `recurring` â\x80\x94 one of `Free` (100/mo), `Essential` (2000/mo), `Growth` (10000/mo), `Ultimate` (50000/mo), or `Custom` for non-standard caps.'}, 'available': {'type': 'number', 'description': 'Total credits the client can spend right now (recurring + active boosters). 1 credit = 1 generated test case. Only `create_tests` and `create_tests_from_spec` decrement this; spec / mock / lookup tools are free.'}, 'exhausted': {'type': 'boolean', 'description': '`true` when `available <= 0`. The agent should surface this and point the user at https://3tg.dev to upgrade or buy a booster before attempting any generation tool â\x80\x94 those will throw QUOTA_EXHAUSTED.'}, 'recurring': {'type': 'number', 'description': 'Monthly cap of the current plan, in test cases per period. This is the DENOMINATOR of the recurring fraction (the maximum, the larger number) â\x80\x94 e.g. 100 on Free, 2000 on Essential. Always >= `recurringRemaining`. When surfacing this to the user as a fraction, render `<recurringRemaining> / <recurring>` (e.g. `96 / 100`) so the spent-vs-cap relationship reads naturally; never write it the other way round.'}, 'endOfPeriod': {'type': 'string', 'description': 'ISO date of the current billing period end.'}, 'startOfPeriod': {'type': 'string', 'description': 'ISO date of the current billing period start.'}, 'recurringRemaining': {'type': 'number', 'description': 'Recurring credits left in the current billing period â\x80\x94 i.e. how many more test cases the user can generate before the period resets (boosters not included). This is the NUMERATOR of the recurring fraction (the smaller number), always <= `recurring`. Decreases over the period as test generation consumes credits; resets to `recurring` at the start of each new period. Render as `<recurringRemaining> / <recurring>` (e.g. `96 / 100`).'}}, 'additionalProperties': False}
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {}, 'description': 'No inputs.', 'additionalProperties': False}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['format', 'content'], 'properties': {'format': {'type': 'string', 'const': 'markdown', 'description': 'Always `markdown` â\x80\x94 the content is GitHub-Flavored Markdown.'}, 'content': {'type': 'string', 'description': 'The full quick-start guide. Paraphrase the relevant section back to the user rather than dumping the whole thing.'}}, 'additionalProperties': False}
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['config'], 'properties': {'config': {'type': 'object', 'description': 'The parsed 3TG configuration object to validate â\x80\x94 the JSON contents of `.3tg/config.3tg.json` or a `.md.3tg.json` file. The agent reads the file from disk, parses it, and forwards the object here. Must be a JSON object (not an array or primitive).', 'propertyNames': {'type': 'string'}, 'additionalProperties': {}}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['valid', 'problems', 'summary'], 'properties': {'valid': {'type': 'boolean', 'description': 'True iff 3TG reported the configuration valid. False on a confirmed schema violation OR an inconclusive run (see `problems` / `rawOutput`).'}, 'summary': {'type': 'string', 'description': 'One-line human summary â\x80\x94 lead with this when reporting back.'}, 'problems': {'type': 'array', 'items': {'type': 'string'}, 'description': 'The specific schema-violation message(s) 3TG printed, with boilerplate stripped (e.g. "Expected `mock-parameters` in `#` to be of type `object` but found `string`."). Empty when valid.'}, 'rawOutput': {'type': 'string', 'description': 'Raw 3TG `-C` output, included only when invalid or inconclusive so the failure can be debugged. Omitted on a clean pass.'}}, 'additionalProperties': False}
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['sourceCode', 'specContent', 'fileName'], 'properties': {'fileName': {'type': 'string', 'minLength': 1, 'description': 'Path of the source file relative to the project root (e.g. "src/foo/bar.ts"). Must end in `.ts` or `.tsx` â\x80\x94 the extension tells 3TG whether to parse a React component table or a unit table. The spec filename is derived by replacing the extension with `.3tg.md`.'}, 'sourceCode': {'type': 'string', 'maxLength': 500000, 'minLength': 1, 'description': 'Full UTF-8 contents of the source file the spec describes. Needed so 3TG can compute the ground-truth list of exported functions and their parameter names to cross-check the spec against.'}, 'specContent': {'type': 'string', 'maxLength': 50000, 'minLength': 1, 'description': 'Full UTF-8 contents of the `.3tg.md` spec to validate â\x80\x94 exactly as it lives under `.3tg/<sourceDir>/<basename>.3tg.md`.'}}, 'additionalProperties': False}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['valid', 'summary', 'diagnostics', 'parsed'], 'properties': {'valid': {'type': 'boolean', 'description': 'True iff there are zero error-severity diagnostics. Warnings and info do NOT flip this to false â\x80\x94 they\'re advisory. `true` means "structurally sound; safe to compile", not "expected values are correct".'}, 'parsed': {'type': 'object', 'required': ['exportedFunctions', 'targetedFunctions', 'parameterColumns', 'derivedConfigKeys', 'hasExpectedReturns'], 'properties': {'parameterColumns': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Parameter/column names the spec produced.'}, 'derivedConfigKeys': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Top-level keys of the config 3TG derived from the spec. An empty array means the spec parsed to nothing.'}, 'exportedFunctions': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Functions/components 3TG found exported in the source.'}, 'targetedFunctions': {'type': 'array', 'items': {'type': 'string'}, 'description': "Functions the spec's tables actually target."}, 'hasExpectedReturns': {'type': 'boolean', 'description': 'Whether the spec carried filled-in `=>` return values.'}}, 'description': 'What 3TG actually parsed â\x80\x94 useful for eyeballing coverage.', 'additionalProperties': False}, 'summary': {'type': 'string', 'description': 'One-line human summary â\x80\x94 lead with this when reporting back.'}, 'diagnostics': {'type': 'array', 'items': {'type': 'object', 'required': ['severity', 'message'], 'properties': {'message': {'type': 'string'}, 'severity': {'enum': ['error', 'warning', 'info'], 'type': 'string'}}, 'additionalProperties': False}, 'description': 'Ordered findings. `error` = will break generation; `warning` = probably a mistake but generation still runs; `info` = advisory (coverage gaps, unverifiable columns).'}}, 'additionalProperties': False}
Modifications récentes des outils
Serveurs MCP similaires
TinyFn
Offers deterministic utility functions for mathematics, conversions, validation, hashing, encoding, arrays, dates, colors, and pa…
hyperion
Acts as a paid MCP tool marketplace and utility gateway with server discovery, HTTP and JavaScript tools, research, data conversi…
Andreax
Offers pay-per-call AI services for inference, agent and workflow design, OCR and transcription, code generation and review, clas…
Vee3
Manages Clerk authentication infrastructure, including users, organizations, domains, sessions, tokens, OAuth, SSO, machines, per…
Courier
Provides notification delivery infrastructure for users, tenants, lists, templates, preferences, journeys, automations, brands, a…
GripForge
Generates, rigs, animates, analyzes, and packages game characters, weapons, armor, effects, environments, and engine-ready assets.
IA-QA — 130+ QA & Dev Tools for AI Agents
Provides deterministic QA, evaluation, testing, code analysis, prompt and RAG checks, model comparison, and web security diagnost…
apis-io
Provides catalog search, comparison, scoring, enrichment, lists, and dataset exports for APIs, providers, specifications, workflo…