Skip to content

Conversation

@echobt
Copy link
Contributor

@echobt echobt commented Feb 4, 2026

Problem

The Glob tool has a parameter naming mismatch between its definition and handler:

  • In src/cortex-engine/src/tools/registry/definitions.rs, the Glob tool definition specifies the parameter name as folder
  • In src/cortex-engine/src/tools/handlers/glob.rs, the GlobArgs struct expects a field named directory

This mismatch can cause deserialization failures when the model sends a folder parameter (based on the tool definition), since serde expects directory.

Solution

Add a serde alias attribute to the directory field in GlobArgs:

#[serde(alias = "folder")]
directory: Option<String>,

This allows the handler to accept both folder and directory parameter names, ensuring compatibility with the tool definition while maintaining backward compatibility with any existing code that uses directory.

echobt added a commit that referenced this pull request Feb 4, 2026
This PR consolidates the following tools fixes:
- #53: Add serde alias for Glob tool folder parameter
- #62: Align tool handler names with registration names
- #63: Add serde alias for Grep tool head_limit parameter

Key changes:
- Added serde aliases for backward compatibility
- Fixed mismatched handler names to match tool registration
- Improved tool parameter handling consistency
@echobt
Copy link
Contributor Author

echobt commented Feb 4, 2026

Consolidated into #75 - fix(tools): consolidated tools parameter aliases and handler name fixes

@echobt echobt closed this Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant