Skip to content

Proposal: Tool categories and filtering #88

@hemanth

Description

@hemanth

Context

When a page registers many tools, agents need a way to discover relevant ones efficiently.

Problem

Our MCP bridge can expose 50+ tools from a server. Without categorization:

  • Agents must parse all tool descriptions
  • Token limits are consumed by irrelevant tools
  • Users see overwhelming tool lists

Proposal

Support tool categorization and filtering:

navigator.modelContext.provideContext({
  tools: [
    {
      name: "search_proposals",
      description: "Search TC39 proposals",
      category: "search",
      tags: ["tc39", "javascript", "ecmascript"],
      inputSchema: { ... },
      execute: async (args) => { ... }
    },
    {
      name: "get_proposal",
      description: "Get proposal details",
      category: "read",
      tags: ["tc39", "javascript"],
      inputSchema: { ... },
      execute: async (args) => { ... }
    },
    {
      name: "compare_proposals",
      description: "Compare two proposals",
      category: "analysis",
      tags: ["tc39", "comparison"],
      inputSchema: { ... },
      execute: async (args) => { ... }
    }
  ]
});

Agent-Side Filtering

// Agent can query for relevant tools
const searchTools = await navigator.modelContext.getTools({ 
  category: "search" 
});

const tc39Tools = await navigator.modelContext.getTools({ 
  tags: ["tc39"] 
});

// Or filter by capability
const readOnlyTools = await navigator.modelContext.getTools({
  capabilities: ["read"] // vs "write", "delete"
});

Standard Categories

Category Description
search Find/query information
read Retrieve specific data
create Create new resources
update Modify existing resources
delete Remove resources
analysis Process/analyze data
navigation Page/UI navigation
media Images, audio, video

Benefits

  1. Efficient tool discovery for agents
  2. Better UX when displaying available tools
  3. Permission scoping by category
  4. Reduced token usage in prompts

This aligns with the proposal's goal of making complex interfaces more navigable for agents.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions