fix(mcp): reject unknown MCP tool inputs (#975)
* fix(mcp): reject unknown official tool inputs * fix(mcp): reject unknown native tool inputs * test(mcp): follow native contract module move * fix(mcp): reject unknown remaining tool inputs * fix(mcp): satisfy strict unknown and browser input schemas Remove obsolete approval fields from residual-unknown fixtures, project update inputs explicitly, and stop passing target_id to list-targets parsing. --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
This commit is contained in:
@@ -30,12 +30,13 @@ const native = <Name extends string, Schema extends z.ZodObject>(
|
||||
inputSchema: Schema,
|
||||
) => {
|
||||
const outputSchema = requireOutputSchema(nativeOutputSchemas, name);
|
||||
const strictInputSchema = inputSchema.strict();
|
||||
return {
|
||||
name,
|
||||
...toolContractMetadata(name),
|
||||
description,
|
||||
kind: "native-provider",
|
||||
inputSchema,
|
||||
inputSchema: strictInputSchema,
|
||||
outputSchema,
|
||||
examples: [
|
||||
{
|
||||
@@ -45,7 +46,7 @@ const native = <Name extends string, Schema extends z.ZodObject>(
|
||||
.parse(examples[name] ?? {}),
|
||||
},
|
||||
],
|
||||
} satisfies ToolContract<Name, Schema, typeof outputSchema>;
|
||||
} satisfies ToolContract<Name, typeof strictInputSchema, typeof outputSchema>;
|
||||
};
|
||||
|
||||
/** Ordered single-line symbols; `swift-demangle` ends each result with LF. */
|
||||
|
||||
Reference in New Issue
Block a user