Identity helper that locks in inputSchema / outputSchema inference for an inline tool
descriptor. Use when writing tools as array elements of tools: McpTool[], where the array
element type otherwise falls back to the default ZodRawShapeCompat generics and widens the
callback return type. Wrapping the descriptor with define_mcp_tool({...}) causes TS to
solve ToolInputType and ToolOutputType from the literal inputSchema / outputSchema
before checking the callback body, so contextual typing flows precisely into the return
expression and content: [{ type: 'text', ... }] keeps its discriminator.
Identity helper that locks in
inputSchema/outputSchemainference for an inline tool descriptor. Use when writing tools as array elements oftools: McpTool[], where the array element type otherwise falls back to the defaultZodRawShapeCompatgenerics and widens thecallbackreturn type. Wrapping the descriptor withdefine_mcp_tool({...})causes TS to solveToolInputTypeandToolOutputTypefrom the literalinputSchema/outputSchemabefore checking the callback body, so contextual typing flows precisely into the return expression andcontent: [{ type: 'text', ... }]keeps its discriminator.