Skip to main content
Glama

opencode_find_symbol

Read-onlyIdempotent

Locate functions, classes, and variables across projects by symbol name. Resolves symbol lookup needs in codebases via workspace search.

Instructions

Find workspace symbols by name (functions, classes, variables, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSymbol name to search for
directoryNoAbsolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo
textYes
isErrorYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, and non-destructive. The description adds 'workspace' scope, implying it only searches within the current workspace, which is a useful behavioral constraint. However, it does not disclose return format, case sensitivity, or indexing behavior. Since annotations cover safety, a 3 is appropriate.

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

Conciseness5/5

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

A single, front-loaded sentence that is extremely concise and includes illustrative examples. No filler or redundant phrasing. The structure is optimal for a simple tool.

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

Completeness4/5

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

For a simple search tool with an output schema and safety annotations, the description is largely sufficient. It could mention whether the search is case-sensitive or requires an LSP server, but these are minor gaps. The presence of an output schema covers return values, and annotations cover side effects. Overall, it is complete enough for correct invocation.

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?

The input schema has 100% coverage, with clear descriptions for both 'query' (symbol name to search for) and 'directory' (absolute path). The tool description does not add any parameter-specific details beyond the schema, so it meets the baseline but adds no extra value.

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?

The description clearly states the tool finds workspace symbols by name, with concrete examples (functions, classes, variables). It is unambiguous and distinguishes this from text/file search by focusing on 'symbols', even though it doesn't name alternatives. The verb 'find' and resource 'workspace symbols' are specific.

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

Usage Guidelines2/5

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

No guidance is given on when to use this tool versus sibling search tools like opencode_find_text or opencode_find_file. The description does not mention scenarios, exclusions, or prerequisites (e.g., needing an initialized project). An agent must infer usage from the name alone.

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

Deploy Server

Other Tools