Skip to main content
Glama

Workspace search code

workspace_search_code
Destructive

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.

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": {
      "query": "<query>"
    },
    "name": "workspace_search_code"
  }
}

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.1/5.0
Behavior4/5

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

Goes well beyond the annotations by explaining that it launches a throwaway sandbox job, shallow-clones, self-terminates, and rejects repositories that are not Application-linked or context-tagged (returning the allowed list). There is mild tension with destructiveHint=true since the text emphasizes 'never touches existing infrastructure', but this reads as scoping the blast radius of job creation rather than contradicting the hint.

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 what it does, then prerequisites, then parameter selection, then the optional path. Every sentence carries distinct information, though the description is dense enough that it could be split for scanability.

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?

With no output schema, it correctly explains the return format (file:line matches) and covers setup prerequisites and rejection behavior. It omits result caps, timeouts, or clone-size limits for a shallow-clone job, which an agent would need to reason about large repos.

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 coverage is 100%, so all five parameters are already documented, including the application_id-or-repository either/or and the rejection behavior. The description restates those relationships helpfully in prose but adds no new syntax, format, or constraint detail beyond the schema.

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') plus the mechanism ('Shallow-clones the repo and runs a ripgrep search') and the return shape ('matching file:line results'). The 'from an ephemeral, locked-down AI workspace on the organisation's staging cluster' framing clearly distinguishes it from a plain code-search sibling.

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 preconditions: a configured staging cluster and either application_id or repository, and calls out that it is safe in ask mode. It does not state explicit when-not-to-use cases or name an alternative tool when the staging cluster is unconfigured, so it stops short of full routing guidance.

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.