Skip to main content
Glama
token-context-mcp

token-context-mcp

Find symbols

find_symbols
Read-onlyIdempotent

Locate declared symbols by exact or wildcard name pattern in a registered repository, filtering by kind and result limit to narrow code context.

Instructions

Match declaration names by exact or wildcard (*, ?) pattern (exact first; no bodies/edges; truncated=true if capped). Use search_source for code text or inspect_symbol for body+edges.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "repo_id": "<repo_id>",
      "pattern": "<pattern>"
    },
    "name": "find_symbols"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindNoOptional declaration kind filter (e.g. 'function', 'class', 'method', 'interface').
limitNoMaximum matches to return (1 to max_symbol_results; defaults to 'locate' profile or server cap, reporting excess in omitted_count).
patternYesSymbol name or qualified-name pattern (supports '*' and '?' wildcards; exact matches rank first).
profileNoNamed budget profile preset ('locate', 'orient', 'impact', 'read'); defaults to 'locate'.
repo_idYesRegistered repository ID from list_repositories (never a filesystem path).
max_tokensNoToken cap for the response (32 to max_result_tokens); defaults to 'locate' profile budget.

Output Schema

NameRequiredDescriptionDefault
dataNoMatched symbol records without bodies or graph edges.
errorNoPresent when the tool call fails (either a structured {code, message, details} object or a diagnostic string).
budgetNoToken budget accounting for this response.
repo_idNoRegistered repository identifier.
evidenceNoSource-verified file line spans and SHA-256 hashes backing the response.
warningsNoFreshness, ambiguity, redaction, or security warnings.
freshnessNoIndex freshness state ('fresh', 'pending', 'stale', or 'unknown').
truncatedNoTrue if items were omitted due to budget or node limits.
ledger_revNoCurrent evidence ledger revision for repo_id.
completenessNoCoverage/resolution completeness indicator.
index_run_idNoIdentifier of the active index snapshot run.
schema_versionNoEnvelope schema version ('1.0').
untrusted_repository_contentNoTrue when payload embeds raw repository text.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.3.8
    • changedInput schema / properties / kind / description
      Previous value: -"Optional symbol kind filter (e.g. 'function', 'class', 'method', 'interface')."New value: +"Optional declaration kind filter (e.g. 'function', 'class', 'method', 'interface')."
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum number of matching symbols to return (1 to max_symbol_results)."New value: +"Maximum matches to return (1 to max_symbol_results; defaults to 'locate' profile or server cap, reporting excess in omitted_count)."
    • changedInput schema / properties / max_tokens / description
      Previous value: -"Maximum token budget for the response (32 to max_result_tokens)."New value: +"Token cap for the response (32 to max_result_tokens); defaults to 'locate' profile budget."
    • changedInput schema / properties / pattern / description
      Previous value: -"Symbol name or qualified-name pattern to match (supports '*' and '?' wildcards)."New value: +"Symbol name or qualified-name pattern (supports '*' and '?' wildcards; exact matches rank first)."
    • changedInput schema / properties / profile / description
      Previous value: -"Named budget profile ('locate', 'orient', 'impact', 'read'); defaults to 'locate'."New value: +"Named budget profile preset ('locate', 'orient', 'impact', 'read'); defaults to 'locate'."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "budget": {
      +      "additionalProperties": true,
      +      "description": "Token budget accounting for this response.",
      +      "properties": {
      +        "envelope_reserve": {
      +          "description": "Wire-framing token reserve when budget >= 512.",
      +          "type": "integer"
      +        },
      +        "estimated_tokens": {
      +          "description": "Estimated serialized response tokens.",
      +          "type": "integer"
      +        },
      +        "requested_tokens": {
      +          "description": "Requested or profile-default token budget.",
      +          "type": "integer"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "completeness": {
      +      "additionalProperties": true,
      +      "description": "Coverage/resolution completeness indicator.",
      +      "properties": {
      +        "basis": {
      +          "description": "How completeness was computed.",
      +          "type": "string"
      +        },
      +        "value": {
      +          "description": "Completeness ratio in [0.0, 1.0], or null if N/A.",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "data": {
      +      "additionalProperties": true,
      +      "description": "Matched symbol records without bodies or graph edges.",
      +      "properties": {
      +        "omitted_count": {
      +          "description": "Number of matches omitted due to limit or budget.",
      +          "type": "integer"
      +        },
      +        "symbols": {
      +          "description": "Matched symbol definitions.",
      +          "items": {
      +            "additionalProperties": true,
      +            "description": "Indexed symbol definition metadata.",
      +            "properties": {
      +              "end_line": {
      +                "description": "1-based declaration end line.",
      +                "type": "integer"
      +              },
      +              "kind": {
      +                "description": "Symbol kind (function, class, method, interface, etc.).",
      +                "type": "string"
      +              },
      +              "name": {
      +                "description": "Short symbol name.",
      +                "type": "string"
      +              },
      +              "path": {
      +                "description": "Repository-relative file path.",
      +                "type": "string"
      +              },
      +              "qualified_name": {
      +                "description": "Qualified symbol name.",
      +                "type": "string"
      +              },
      +              "roles": {
      +                "description": "Detected semantic/architectural roles.",
      +                "items": {
      +                  "type": "string"
      +                },
      +                "type": "array"
      +              },
      +              "signature": {
      +                "description": "Declaration signature header.",
      +                "type": "string"
      +              },
      +              "start_line": {
      +                "description": "1-based declaration start line.",
      +                "type": "integer"
      +              },
      +              "symbol_id": {
      +                "description": "Canonical repository-scoped symbol identifier.",
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "total_matches": {
      +          "description": "Total matches before limit/budget truncation.",
      +          "type": "integer"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "error": {
      +      "additionalProperties": true,
      +      "description": "Present when the tool call fails (either a structured {code, message, details} object or a diagnostic string).",
      +      "properties": {
      +        "code": {
      +          "description": "Machine-readable error code.",
      +          "type": "string"
      +        },
      +        "details": {
      +          "description": "Optional structured metadata for the error.",
      +          "type": "object"
      +        },
      +        "message": {
      +          "description": "Human-readable error explanation.",
      +          "type": "string"
      +        }
      +      },
      +      "type": [
      +        "object",
      +        "string"
      +      ]
      +    },
      +    "evidence": {
      +      "description": "Source-verified file line spans and SHA-256 hashes backing the response.",
      +      "items": {
      +        "additionalProperties": true,
      +        "properties": {
      +          "end_line": {
      +            "description": "1-based end line in source.",
      +            "type": "integer"
      +          },
      +          "path": {
      +            "description": "Repository-relative file path.",
      +            "type": "string"
      +          },
      +          "sha256": {
      +            "description": "12-character hex prefix of indexed file SHA-256.",
      +            "type": "string"
      +          },
      +          "start_line": {
      +            "description": "1-based start line in source.",
      +            "type": "integer"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "freshness": {
      +      "description": "Index freshness state ('fresh', 'pending', 'stale', or 'unknown').",
      +      "type": "string"
      +    },
      +    "index_run_id": {
      +      "description": "Identifier of the active index snapshot run.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "ledger_rev": {
      +      "description": "Current evidence ledger revision for repo_id.",
      +      "type": "integer"
      +    },
      +    "repo_id": {
      +      "description": "Registered repository identifier.",
      +      "type": "string"
      +    },
      +    "schema_version": {
      +      "description": "Envelope schema version ('1.0').",
      +      "type": "string"
      +    },
      +    "truncated": {
      +      "description": "True if items were omitted due to budget or node limits.",
      +      "type": "boolean"
      +    },
      +    "untrusted_repository_content": {
      +      "description": "True when payload embeds raw repository text.",
      +      "type": "boolean"
      +    },
      +    "warnings": {
      +      "description": "Freshness, ambiguity, redaction, or security warnings.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed6 schema fields changedv0.3.7
    • addedInput schema / properties / kind / description
      Added value: +"Optional symbol kind filter (e.g. 'function', 'class', 'method', 'interface')."
    • addedInput schema / properties / limit / description
      Added value: +"Maximum number of matching symbols to return (1 to max_symbol_results)."
    • addedInput schema / properties / max_tokens / description
      Added value: +"Maximum token budget for the response (32 to max_result_tokens)."
    • addedInput schema / properties / pattern / description
      Added value: +"Symbol name or qualified-name pattern to match (supports '*' and '?' wildcards)."
    • addedInput schema / properties / profile / description
      Added value: +"Named budget profile ('locate', 'orient', 'impact', 'read'); defaults to 'locate'."
    • addedInput schema / properties / repo_id / description
      Added value: +"Registered repository ID from list_repositories (never a filesystem path)."
  3. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover the safe-read profile (readOnlyHint, idempotentHint, non-destructive), so the description's added value is the ranking rule (exact matches first) and the truncation signal (truncated=true when capped). It does not describe how omitted_count or ordering interacts with limit, but the core behavior is disclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two tight sentences, front-loaded with the matching rule before the routing guidance. The parenthetical shorthand ('no bodies/edges') is slightly compressed but still readable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present and annotations covering safety, the description only needed to state scope, ordering, and truncation — all of which it does. Nothing required to call this correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description's mention of wildcard syntax and exact-first ranking duplicates what the pattern parameter description already says, adding no new meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource: matching declaration names by exact or wildcard pattern. It also scopes the result explicitly ('no bodies/edges'), which separates it from siblings that return source text or graph edges.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Names two alternatives with the condition that selects each: search_source for code text, inspect_symbol for body+edges. An agent can route without inspecting sibling schemas.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.