Skip to main content
Glama

workspace_search_code

Search a source repository from an ephemeral, locked-down AI workspace on the organisation's staging cluster. Shallow-clones the repo and runs a ripgrep search for the query, returning matching file:line results. Safe in ask mode: it runs a throwaway sandbox job that self-terminates and never touches existing infrastructure. Requires a configured staging cluster (Organisation settings -> AI -> Environment) plus either application_id (clone that Application's linked repository) or repository ('owner/name' - an Application-linked repository or one of the cluster's tagged context repositories). Optional 'path' narrows the search to a subdirectory.

Input Schema

NameRequiredDescriptionDefault
pathNoOptional subdirectory (relative to the repo root) to limit the search to.
queryYesThe ripgrep pattern to search for across the repository.
branchNoOptional branch to clone. Defaults to the context tag's branch, the Application's configured branch, or the repository's default branch.
repositoryNoRepository to clone in 'owner/name' form. Must be an Application-linked repository or one of the cluster's tagged context repositories; anything else is rejected with the allowed list.
application_idNoThe Application whose linked repository to clone and search. Provide this or 'repository'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations declare readOnlyHint=false, which could mislead an agent into thinking this mutates infrastructure; the description reconciles this by explaining it runs a throwaway sandbox job that self-terminates and never touches existing infrastructure. It also discloses the clone-plus-ripgrep execution model and the environment prerequisite, adding real context beyond the structured fields.

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?

Front-loads the purpose and mechanism before prerequisites, and each sentence carries distinct information. It is a dense single paragraph, slightly longer than strictly needed, but nothing is redundant with the schema.

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?

For a 5-parameter tool with no output schema, the description covers purpose, execution model, safety, environment requirement, parameter selection, and even the return shape ('file:line results'). An agent has everything needed to decide whether and how to call it.

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 schema already documents all five parameters thoroughly (branch defaults, rejection of non-allowed repos, etc.). The description reinforces the either/or relationship between application_id and repository and that path narrows the search, but adds little the schema does not already carry, so the baseline 3 applies.

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 and resource ('Search a source repository') and adds mechanism ('shallow-clones the repo and runs a ripgrep search'), which clearly distinguishes it from github_search_code and workspace_read_file. The 'file:line results' scoping further pins down what the tool returns.

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?

Gives concrete prerequisites (a configured staging cluster plus either application_id or repository) and a safety condition ('Safe in ask mode'), which tells the agent when the tool is viable. It does not, however, name an alternative sibling (e.g. github_search_code) or state when not to use it, so routing between the several code-search tools is left to inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources