Skip to content

[Feature]: Add metadata-based tool filtering support to CugaAgent #38

@Harmedox

Description

@Harmedox

Feature Request

Add an optional filter_criteria parameter to CugaAgent that filters tools based on their metadata attributes.

Motivation / Problem

When working with large tool sets or multiple tool providers, there's currently no way to filter which tools are available to the agent based on metadata attributes. This becomes critical in scenarios like:

  • Multi-domain benchmarks: Scope tools to specific domains (e.g., "hockey", "olympics") to prevent cross-contamination
  • Environment isolation: Separate tools by environment (dev, staging, production)
  • Regional compliance: Filter tools by geographic region
  • Category-based access control: Limit tools by category or functional area

Use Case

In the M3 benchmark evaluation, we have tools from multiple domains (hockey, olympics, address) loaded simultaneously. Without filtering, the agent might use hockey tools when answering olympics questions. With this feature:

# Create agent scoped to hockey domain
evaluator.agent = CugaAgent(
    tool_provider=tool_provider,
    filter_criteria={"domain": "hockey"}
)

This ensures the agent only sees hockey-related tools, preventing cross-domain contamination.

Proposed Solution

The feature requires changes to three areas:

  1. CugaAgent: Add filter_criteria parameter to __init__()
  2. Graph Creation: Update create_cuga_lite_graph() to accept and pass filter_criteria
  3. Tool Discovery: Update create_find_tools_tool() to filter based on criteria

Alternatives Considered

No response

Priority

High - Important for my workflow

Implementation Complexity (if known)

Simple - Small change or addition

Additional Context

No response

Checklist

  • I have searched existing issues and feature requests to ensure this is not a duplicate
  • I have provided a clear use case and motivation for this feature
  • I am willing to help test this feature once implemented
  • I am interested in contributing to the implementation of this feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions