Skip to content

Feature Request: Optimize MCP Tool Schemas for AI Agent Token Efficiency #340

Closed

Description

@gabacool

Summary

The current MCP tool schemas for chrome-devtools-mcp are very comprehensive but verbose, which increases token usage for AI agents. By applying schema optimization techniques, we can reduce token consumption by ~40% while maintaining full functionality and clarity.

Motivation

AI agents consuming MCP tool schemas pay a token cost for every tool discovery. Verbose schemas with:

  • Extensive oneOf description blocks
  • Multiple examples per field (3-5 examples)
  • Redundant explanatory text

...lead to unnecessary token usage without adding value for AI comprehension.

Proposed Solution

Apply the following optimizations:

1. Remove Verbose oneOf Descriptions

Before:

enum: ['summary', 'detailed', 'analytics'],
oneOf: [
  {
    const: 'summary',
    description: 'Basic results with session info, relevance scores, and key matches'
  },
  {
    const: 'detailed',
    description: 'Comprehensive results including entity/relationship details'
  },
  {
    const: 'analytics',
    description: 'Full analytics including search performance and scoring'
  }
]

After:

enum: ['summary', 'detailed', 'analytics'],
description: 'Result format: summary, detailed, or analytics'

AI agents can infer meaning from enum values + concise description.

2. Reduce Example Arrays

Before:

examples: ['30d', '3m', '1y', '7d', '24h']

After:

examples: ['30d']

One representative example is sufficient for AI understanding.

3. Condense Descriptions

Before:

description: 'Maximum number of results to return (minimum 1, maximum 200, default: 50)'

After:

description: 'Max results (1-200, default: 50)'

AI agents parse structured data (min/max/default) from schema properties, not descriptions.

Benefits for Chrome DevTools MCP

Given the extensive tool catalog in chrome-devtools-mcp (navigation, screenshots, performance, network, etc.), applying these optimizations could yield significant token savings while improving AI agent performance.

Compatibility

These optimizations:

  • ✅ Maintain full JSON Schema compliance
  • ✅ Keep all validation rules (patterns, min/max, required fields)
  • ✅ Preserve error messages for user guidance
  • ✅ Do not break existing integrations

Additional Context: Token Usage Impact

Current State:
The chrome-devtools-mcp currently consumes ~17,000 tokens just for initial tool discovery.

This means a single MCP consumes over two-thirds of the recommended token budget, leaving minimal room for:

  • Other essential MCPs (file system, git, database, etc.)
  • Actual conversation context
  • User prompts and responses

After Optimization (estimated):
Applying the 40% reduction

  • Current: ~17,000 tokens
  • Optimized: ~10,200 tokens
  • Savings: ~6,800 tokens
    This would free up enough tokens for 2-3 additional medium-sized MCPs or significantly more conversation context.

Activity

  1. natorion commented on Oct 14, 2025

    @natorion
    Contributor

    Making tool description more efficient is useful. Please keep in mind that there is also the risk of negative side effects e.g. tool calls not happening or tools call are happening in the wrong shape.

    Seems like you already have ideas on what to change. Could you please try out your proposed changes with common MCP clients and common use cases, and report back on the results, in particular about:: a.) token consumption b.) tool call frequency c.) tool call success

    Thanks!

  2. OrKoN commented on Oct 22, 2025

    @OrKoN
    Collaborator

    We do not have any oneOff or examples and we try to keep our descriptions concise. Generally, we want to reduce the footprint of chrome-devtools-mcp server but this is issue is too general to be actionable. If you see specific improvements that could be done, please file a dedicated issue. The latest release has some of those improvements + ability to disable tools you do not plan to use.

  3. semikolon commented on Jan 25, 2026

    @semikolon

    This issue inspired me to fork chrome-devtools-mcp and implement specific token optimization features:

    PR: #833

    Implemented features:

    • maxLength parameter on take_snapshot - truncates output with notice
    • selector parameter on take_snapshot - limits scope to CSS selector subtree
    • maxWidth/maxHeight on take_screenshot - resizes images (using sharp)

    These are the "specific improvements" mentioned in the closing comment.

  4. Dave-London commented on Mar 8, 2026

    @Dave-London

    Great feature request. We tackled this exact problem for dev CLI tools in Pare — using outputSchema + structuredContent to return only actionable fields. Consistently seeing 60-92% token reduction on the output side. Happy to share patterns if it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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