Bug Description
The search_docs MCP tool returns an error because the Mintlify docs endpoint (https://trigger.dev/docs/mcp) renamed its tool from SearchTriggerDev to search_trigger_dev.
Error
MCP error -32602: Invalid tools/call result: [
{
"expected": "object",
"code": "invalid_type",
"path": [],
"message": "Invalid input: expected object, received undefined"
}
]
Root Cause
In dist/esm/mcp/mintlifyClient.js, the performSearch function calls:
const body = callToolBody("SearchTriggerDev", { query });
But the Mintlify endpoint now only has a tool named search_trigger_dev:
curl -s -X POST "https://trigger.dev/docs/mcp" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "MCP-Protocol-Version: 2025-06-18" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
Returns:
{"result":{"tools":[{"name":"search_trigger_dev",...}]}}
And calling SearchTriggerDev returns:
{"error":{"code":-32602,"message":"MCP error -32602: Tool SearchTriggerDev not found"}}
Fix
In mintlifyClient.ts, change:
const body = callToolBody("SearchTriggerDev", { query });
to:
const body = callToolBody("search_trigger_dev", { query });
Additionally, the handler in tools/docs.ts does return results.result but should handle the case where results wraps the response in an SSE data event that already contains the result key — currently when the API returns an error (tool not found), results.result is undefined, causing the Zod validation error.
Reproduction
- Run
npx trigger.dev@latest mcp
- Call the
search_docs tool with any query
- Observe the
-32602 error
Environment
- trigger.dev CLI: 4.4.3
- Affects all versions since Mintlify renamed the tool