Skip to main content
Glama
ennuiii

Azure DevOps MCP Server with PAT Authentication

by ennuiii

search_wiki

Find specific content in Azure DevOps Wiki by searching with keywords. Filter results by projects or wiki names, include facets, and control pagination for precise, organized outcomes.

Instructions

Search Azure DevOps Wiki for a given search text

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeFacetsNoInclude facets in the search results
projectNoFilter by projects
searchTextYesKeywords to search for wiki pages
skipNoNumber of results to skip
topNoMaximum number of results to return
wikiNoFilter by wiki names

Implementation Reference

  • Handler function for the 'search_wiki' tool that performs a search query against the Azure DevOps Wiki Search API using a POST request with filters.
    async ({ searchText, project, wiki, includeFacets, skip, top }) => {
      const accessToken = await tokenProvider();
      const url = `https://almsearch.dev.azure.com/${orgName}/_apis/search/wikisearchresults?api-version=${apiVersion}`;
    
      const requestBody: Record<string, unknown> = {
        searchText,
        includeFacets,
        $skip: skip,
        $top: top,
      };
    
      const filters: Record<string, string[]> = {};
      if (project && project.length > 0) filters.Project = project;
      if (wiki && wiki.length > 0) filters.Wiki = wiki;
    
      if (Object.keys(filters).length > 0) {
        requestBody.filters = filters;
      }
    
      const response = await fetch(url, {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          "Authorization": `Bearer ${accessToken.token}`,
          "User-Agent": userAgentProvider(),
        },
        body: JSON.stringify(requestBody),
      });
    
      if (!response.ok) {
        throw new Error(`Azure DevOps Wiki Search API error: ${response.status} ${response.statusText}`);
      }
    
      const result = await response.text();
      return {
        content: [{ type: "text", text: result }],
      };
    }
  • Zod schema defining the input parameters for the 'search_wiki' tool.
    {
      searchText: z.string().describe("Keywords to search for wiki pages"),
      project: z.array(z.string()).optional().describe("Filter by projects"),
      wiki: z.array(z.string()).optional().describe("Filter by wiki names"),
      includeFacets: z.boolean().default(false).describe("Include facets in the search results"),
      skip: z.number().default(0).describe("Number of results to skip"),
      top: z.number().default(10).describe("Maximum number of results to return"),
    },
  • Registration of the 'search_wiki' tool using McpServer's server.tool method, including name, description, schema, and handler.
    server.tool(
      SEARCH_TOOLS.search_wiki,
      "Search Azure DevOps Wiki for a given search text",
      {
        searchText: z.string().describe("Keywords to search for wiki pages"),
        project: z.array(z.string()).optional().describe("Filter by projects"),
        wiki: z.array(z.string()).optional().describe("Filter by wiki names"),
        includeFacets: z.boolean().default(false).describe("Include facets in the search results"),
        skip: z.number().default(0).describe("Number of results to skip"),
        top: z.number().default(10).describe("Maximum number of results to return"),
      },
      async ({ searchText, project, wiki, includeFacets, skip, top }) => {
        const accessToken = await tokenProvider();
        const url = `https://almsearch.dev.azure.com/${orgName}/_apis/search/wikisearchresults?api-version=${apiVersion}`;
    
        const requestBody: Record<string, unknown> = {
          searchText,
          includeFacets,
          $skip: skip,
          $top: top,
        };
    
        const filters: Record<string, string[]> = {};
        if (project && project.length > 0) filters.Project = project;
        if (wiki && wiki.length > 0) filters.Wiki = wiki;
    
        if (Object.keys(filters).length > 0) {
          requestBody.filters = filters;
        }
    
        const response = await fetch(url, {
          method: "POST",
          headers: {
            "Content-Type": "application/json",
            "Authorization": `Bearer ${accessToken.token}`,
            "User-Agent": userAgentProvider(),
          },
          body: JSON.stringify(requestBody),
        });
    
        if (!response.ok) {
          throw new Error(`Azure DevOps Wiki Search API error: ${response.status} ${response.statusText}`);
        }
    
        const result = await response.text();
        return {
          content: [{ type: "text", text: result }],
        };
      }
    );
  • Constant defining the tool names, including 'search_wiki' used in registration.
    const SEARCH_TOOLS = {
      search_code: "search_code",
      search_wiki: "search_wiki",
      search_workitem: "search_workitem",
    };
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but offers minimal information. It doesn't mention whether this is a read-only operation, what permissions are required, how results are structured, pagination behavior, or rate limits. The description only states what the tool does at a high level without revealing operational characteristics.

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 a single, efficient sentence that states the core functionality without unnecessary words. It's front-loaded with the essential information and contains no redundant phrases. Every word earns its place in conveying the tool's purpose.

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?

For a search tool with 6 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what the search returns (page titles, snippets, full content?), how results are ordered, or error conditions. While the schema covers parameter definitions, the description fails to provide the contextual understanding needed for effective tool selection and use.

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 all parameters are documented in the schema itself. The description adds no additional parameter semantics beyond implying that 'searchText' is the primary input. It doesn't explain search syntax, result ranking, or how filters interact. With complete schema coverage, the baseline of 3 is appropriate as the description doesn't compensate but doesn't need to.

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 clearly states the action ('Search') and target resource ('Azure DevOps Wiki'), making the purpose immediately understandable. It distinguishes itself from sibling tools like 'search_code' and 'search_workitem' by specifying the wiki domain. However, it doesn't explicitly differentiate from other wiki tools like 'wiki_list_pages' or 'wiki_get_page_content', which could provide similar functionality through browsing rather than search.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when search is preferable to browsing wiki pages directly (e.g., 'wiki_list_pages'), nor does it specify prerequisites like authentication or project context. The agent must infer usage from the tool name and parameters alone.

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

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ennuiii/DevOpsMcpPAT'

If you have feedback or need assistance with the MCP directory API, please join our Discord server