New Your team’s decisions, in one playbook every coding agent works from. Never answer your agent twice

create_spec

Generate a functional-requirements spec (.3tg.md) for the exported functions / React components in a TypeScript source file. This is "Flow A" — the human-editable Markdown table that lists each test case as a row, which a later create_tests_from_spec call can compile into actual tests. AI enrichm...

SERVER3TG Test Generation SOURCEhttps://mcp.3tg.dev/mcp
Medium RISK CLASS
Category Write
Parameters 63 required
Recommended Rate-limitedsee the rule below
Registry record Grade D, identity unverified Pull the record →

This record as markdown: /tools/dev-3tg-mcp/create-spec.md

What create_spec does on 3TG Test Generation

AI agents use create_spec to create or update resources in 3TG Test Generation, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your 3TG Test Generation environment.

ParameterTypeRequiredDescription
clientId string Yes The 3tg.dev client ID.
fileName string Yes 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.
settings object Subset of .3tg/settings.json relevant to this tool.
cliConfig object 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
moduleType string Optional Node module type of the consumer project — the value of the `type` field in the project root's `package.json`. The agent reads that one field (only) an
sourceCode string Yes Full UTF-8 contents of the source file.

Parameters from the server's own tool schema.

Why create_spec is rated Medium

This is a Write operation: it creates a new spec file artifact that documents test requirements. While the output is structured and machine-consumed later, the operation is reversible (the file can be edited, deleted, or regenerated), and it does not execute code, delete data, or move money. The generated spec is configuration/metadata, not executable operations.

From the tool's definition The tool creates or generates a functional-requirements spec file (`.3tg.md`) from TypeScript source. The description states it generates output that is 'human-editable' and can be 'close to runnable,' indicating reversible creation of structured…

Risk signalsAccepts file system path (fileName) · High parameter count (11 properties) · Admin/system-level operation

Questions about create_spec

What does the create_spec tool do? +

Generate a functional-requirements spec (.3tg.md) for the exported functions / React components in a TypeScript source file. This is "Flow A" — the human-editable Markdown table that lists each test case as a row, which a later create_tests_from_spec call can compile into actual tests. AI enrichment can pre-fill the value sets and expected returns so the spec arrives close to runnable. IMPORTANT — never hand-author a .3tg.md yourself. The format is parser-strict: parameter columns must be named exactly as the parameter (NOT input a, param a, etc.), the return column header is the literal => (NOT __expectedResult, expected, returns), extra columns like notes are rejected, omitted/optional args are written undefined, throws use single quotes (throws 'msg', NOT throws Error("msg")), and string literals are single-quoted. Always call this tool to emit the scaffold; the user can then edit rows. The returned .3tg.md is reported under the project's .3tg/ mirror (e.g. source src/foo/bar.ts → spec .3tg/src/foo/bar.3tg.md). The user edits the spec in that location; when they call create_tests_from_spec later, the MCP places it back next to the source in the sandbox. Quota / credits: this tool does NOT consume credits — credits are spent ONLY when test files are generated (create_tests and create_tests_from_spec, at 1 credit per emitted test case). Spec generation is free; iterate on the scaffold as often as needed. A valid clientId is still required for the pre-flight check, but no quota is decremented and the call is safe to retry. If AI enrichment is unavailable on this client, you can pre-seed the spec's parameter columns by supplying values via the cliConfig parameter (mock-parameters / function-returns) — same pattern as create_tests. Do NOT autonomously write .3tg/config.3tg.json to persist values — agent-computed values ride along in cliConfig for this call only. (Explicit user requests to edit the file are fine — handle those normally.) See the cliConfig parameter description for the full shape. CRITICAL POST-CALL ACTION — write returned files to disk: The MCP server does NOT touch the user's filesystem. It returns the generated file CONTENTS in the response's files array. After this tool returns, you MUST iterate over files and write each entry's content verbatim to its path using your native file-write capability (e.g. Write / edit_file / create_file — whatever your client exposes). Create parent directories as needed. Returned paths are project-root-relative and already translated to the .3tg/ mirror convention where applicable (e.g. specs land under .3tg/<source-path>.3tg.md; tests / mocks travel through unchanged). Write each path verbatim. Do NOT claim "Generated test file: <path>" unless you have actually written the file. The user will assume the MCP wrote it and waste time looking for a non-existent file. If you can't write for some reason (permission denied, no write capability in this client), return the contents inline in your message so the user can copy-paste them. Never report success silently when the write didn't happen. It is categorised as a Write tool in the 3TG Test Generation MCP Server, which means it can create or modify data. Consider rate limits to prevent runaway writes.

What parameters does create_spec accept? +

create_spec accepts 6 parameters: clientId, fileName, settings, cliConfig, moduleType, sourceCode. Required: clientId, fileName, sourceCode. The full parameter table on this page comes from the server's own tool schema.

How do I enforce a policy on create_spec? +

Register the 3TG Test Generation MCP server in PolicyLayer and add a rule for create_spec: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches 3TG Test Generation. Nothing to install.

What risk level is create_spec? +

create_spec is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.

Can I rate-limit create_spec? +

Yes. Add a rate_limit block to the create_spec rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.

How do I block create_spec completely? +

Set action: deny in the PolicyLayer policy for create_spec. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.

What MCP server provides create_spec? +

create_spec is provided by the 3TG Test Generation MCP server (https://mcp.3tg.dev/mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.

More on 3TG Test Generation, and thousands of servers like it.

// THE MCP REGISTRY

PolicyLayer tracks 44,603 MCP servers and 515,000+ tools.

Every server has a live record: who publishes it, whether it answers without auth, its risk grade, every tool classified, the recommended policy. This page is one line of 3TG Test Generation's. Pull the full record:

Teams ship this data inside their own products. See what a licence covers →

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.