Skip to content

"jsonSchema not initialized" intermittent error when calling agent.mcp.getAITools() #718

@jldec

Description

@jldec

After upgrading to latest agent sdk I noticed this intermittent error.
The agent stops handling messages after the error happens.

Error on server: Error: jsonSchema not initialized.
    at MCPClientManager.getAITools (/Users/jldec/cloudflare/redwood/agents-chat/node_modules/.vite/deps_worker/chunk-UBIZWKXI.js:2263:33)
    at ChatAgentAgentDO.onChatMessage (/Users/jldec/cloudflare/redwood/agents-chat/src/app/chat-agent-agent/ChatAgentAgentDO.ts:26:19)
    at /Users/jldec/cloudflare/redwood/agents-chat/node_modules/.vite/deps_worker/agents_ai-chat-agent.js:168:32
Override onError(error) to handle server errors 

I have an attempted repro in jldec/agents-chat#111

That PR removes the workaround which avoids the call to mcp.getAITools()
My project is a bit old, and may be using some old APIs. This issue is not a blocker for me - feel free to prioritize accordingly.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions