Skip to main content
Glama
jenkeeri
by jenkeeri

Search OpenGrok

opengrok_search
Read-onlyIdempotent

Search indexed source code by full-text, definition, symbol, path, or commit history, combining fields with AND. Returns matching files with line numbers, supports paging and file type filters.

Instructions

Search source code. Provide at least one of full, def, symbol, path, hist; fields combine with AND.

  • full: full-text Lucene query. Supports wildcards (foo*), phrases ("a b"), AND/OR/NOT (uppercase), fuzzy (word~), regex (/re/).

  • def: where a symbol is DEFINED. symbol: where a symbol is referenced or defined. Both need language-aware indexing, so they return nothing for file types OpenGrok cannot parse; fall back to full.

  • path: restrict by file path (e.g. "src/net", "*.cpp").

  • hist: search commit messages.

  • type: OpenGrok analyzer name, e.g. c, cxx, java, python, sh, xml, json, yaml, plain. An unknown name yields zero results. Default scope: none (all projects). Results list files with matching lines (line numbers where available).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
defNoSymbol whose definition to find.
fullNoFull-text query.
histNoHistory/commit message query.
pathNoPath filter.
typeNoFile type (analyzer name).
startNoOffset of the first file to return (default 0); use the value a previous page suggested.
symbolNoSymbol to find references to.
projectsNoProjects to search (default: none (all projects)). Names from opengrok_list_projects.
max_resultsNoFiles per page (default 20, max 100).
all_projectsNoSearch every project instead of the default. Ignored if projects is set.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already establish readOnlyHint=true, openWorldHint=true, idempotentHint=true, and destructiveHint=false. Beyond that, the description discloses important behavioral limits: def and symbol return nothing for file types OpenGrok cannot parse, unknown analyzer names yield zero results, default scope is all projects, and results list files with matching lines and line numbers where available. These details materially help an agent predict outcomes and avoid wasted calls.

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?

The description is front-loaded with the core purpose and then organized as compact bullet points for each query field. Despite covering many parameters, every sentence contributes useful meaning, and there is no redundant or filler language.

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 tool with 10 parameters, no required parameters, and no output schema, the description covers query modes, AND combination, fallback behavior, default scope, and the basic return shape. It omits pagination semantics for start and max_results and does not mention opengrok_list_projects for discovering project names, though the schema covers those details. It is largely complete but not exhaustive.

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

Parameters5/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds substantial semantic detail beyond the schema. It explains Lucene syntax for full (wildcards, phrases, uppercase AND/OR/NOT, fuzzy, regex), the semantic difference between def and symbol, path examples such as 'src/net' and '*.cpp', and concrete analyzer names for type. This is far richer than the terse schema descriptions.

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

Purpose4/5

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

The description opens with a specific verb and resource: 'Search source code.' It clearly explains the distinct query modes (full, def, symbol, path, hist, type) and how they combine with AND. It does not explicitly distinguish itself from siblings such as opengrok_find_file or opengrok_get_file, so it falls short of a 5.

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

Usage Guidelines4/5

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

It gives clear invocation guidance: 'Provide at least one of full, def, symbol, path, hist; fields combine with AND,' and tells the agent to fall back to full when def or symbol cannot work due to language-aware indexing limits. It does not name any sibling tool as an alternative or state when not to use this tool, so it is not a 5.

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