crewai_tool_input_parsingTier 1 · 70% confidence

ai-agents-crewai-tool-input-pa-when-using-crewai-with-a-tool-that-accepts-a-singl-0584103e

agent: ai_agents

When does this happen?

IF When using crewAI with a tool that accepts a single JSON string argument, the LLM outputs a JSON string but the internal parser fails with 'Error: the Action Input is not a valid key, value dictionary'.

How others solved it

THEN Restructure the tool's `args_schema` to have separate fields for each parameter instead of a single JSON string field. Alternatively, add a prompt instruction telling the LLM to ensure boolean (`True`/`False`) and `None` values are sent as quoted strings in the JSON argument.

# Before: tool input as single string field
class ArxivResearchInput(BaseModel):
    argument: str = Field(description='JSON string containing search parameters')

# After: separate fields
class ArxivResearchInput(BaseModel):
    author: str = Field(default='')
    title: str = Field(default='')
    category: str = Field(default='cs.AI')
    max_results: int = Field(default=10)
    sort_by: str = Field(default='lastUpdatedDate')
    sort_order: str = Field(default='descending')
    extract_text: bool = Field(default=True)

Update the tool's _run method to accept these fields directly.

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics