Tools have JSON Schema inputSchema with types, required fields, and descriptions
Why it matters
Without a JSON Schema inputSchema, AI clients have no contract for what arguments a tool accepts — they guess at parameter names, types, and format. OWASP LLM09 (Misinformation) is the direct risk: the AI constructs plausible-looking but wrong invocations, producing silently incorrect behavior. Missing required-field markers mean the AI may omit critical parameters; missing descriptions mean it cannot distinguish a file path from a query string. In prompt-injection scenarios (CWE-20, OWASP A03), undefined inputs widen the attack surface because the server cannot reject malformed or adversarial arguments before execution.
Severity rationale
Critical because a missing inputSchema means the AI client has no enforceable contract, so every tool invocation is a guess that can silently corrupt behavior or enable injection (CWE-20).
Remediation
Add a Zod schema as the third argument to every server.tool() call in your TypeScript MCP server. The SDK converts it to inputSchema automatically.
// src/tools/search.ts
server.tool(
'search_files',
'Search for files matching a glob pattern',
{
pattern: z.string().describe('Glob pattern, e.g. "**/*.ts"'),
directory: z.string().optional().describe('Root directory to search; defaults to project root'),
maxResults: z.number().int().min(1).max(500).default(50),
},
async ({ pattern, directory, maxResults }) => {
// handler
}
)
For Python, add type annotations and a docstring with Args: block — the SDK derives the schema from them automatically.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the MCP Server Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-20 — Improper Input Validation
- owasp:2021 · A03
- owasp-llm:2025 · LLM09 — Misinformation (AI guesses at unschematized parameters)
- external · mcp-spec-tool-inputschema — MCP Specification — Tool inputSchema
Taxons
History
- 2026-04-18·v1.0.0·Initial import from mcp-server·automated