Skip to main content
Glama
Azure DevOps MCP Server

Azure DevOps MCP Server

search_code

Read-only

Search code across Azure DevOps repositories in a project to find files, snippets, and content by text query, with filters for repository, branch, path, and code element.

Instructions

Search for code across repositories in a project

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": {
      "searchText": "<searchText>",
      "top": "<top>",
      "skip": "<skip>",
      "includeSnippet": "<includeSnippet>",
      "includeContent": "<includeContent>"
    },
    "name": "search_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
topYesNumber of results to return (default: 100, max: 1000)
skipYesNumber of results to skip for pagination (default: 0)
filtersNoOptional filters to narrow search results
projectIdNoThe ID or name of the project to search in (Default: MyProject). If not provided, the default project will be used.
searchTextYesThe text to search for
includeContentYesWhether to include full file content in results (default: true)
includeSnippetYesWhether to include code snippets in results (default: true)
organizationIdNoThe ID or name of the organization (Default: mycompany)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.0.6
    • addedInput schema / properties / skip / maximum
      Added value: +9007199254740991
    • changedInput schema / required
      Previous value: -[
      -  "searchText"
      -]New value: +[
      +  "searchText",
      +  "top",
      +  "skip",
      +  "includeSnippet",
      +  "includeContent"
      +]
  2. Changed3 schema fields changedv1.0.0
    • addedInput schema / properties / organizationId
      Added value: +{
      +  "description": "The ID or name of the organization (Default: mycompany)",
      +  "type": "string"
      +}
    • changedInput schema / properties / projectId / description
      Previous value: -"The ID or name of the project to search in"New value: +"The ID or name of the project to search in (Default: MyProject). If not provided, the default project will be used."
    • changedInput schema / required
      Previous value: -[
      -  "searchText",
      -  "projectId"
      -]New value: +[
      +  "searchText"
      +]
  3. First observed

TDQS

C2.9/5.0
Behavior2/5

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

The annotations already declare readOnlyHint=true, so the safety profile is covered; the description adds nothing on top — no mention of result caps, pagination behavior, or how snippets/content are returned. For an 8-parameter search tool with a nested filters object, this leaves the agent with no behavioral context beyond 'it reads'.

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?

A single front-loaded sentence with no filler or redundancy. It is centered on the resource and scope, though its brevity borders on under-specification rather than tight economy.

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

Completeness2/5

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

Five required parameters, a nested filters object, and no output schema mean the description should carry more weight than one clause. It omits pagination semantics, default project/organization resolution, and what results contain, all of which matter for calling this correctly.

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%, including defaults and min/max on top and skip and descriptions on each filter key, so the schema carries parameter meaning entirely. The description names none of the parameters and adds no semantics beyond it, making the baseline 3 appropriate.

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?

States a specific verb ('Search') and resource ('code') plus scope ('across repositories in a project'), which distinguishes it from text-search siblings like search_wiki and search_work_items. It stops short of naming any alternative explicitly, so it lands just below 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 Guidelines2/5

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

There is no guidance on when to choose this over search_wiki or search_work_items, no prerequisites, and no statement of when not to use it. The only implied usage is 'you want code, not wiki pages or work items,' which the agent must infer from the resource noun alone.

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