Skip to main content
Glama
ennuiii

Azure DevOps MCP Server with PAT Authentication

by ennuiii

core_list_projects

List Azure DevOps projects by state, name, or pagination parameters using PAT authentication. Customize results with filters for project name, state, and pagination.

Instructions

Retrieve a list of projects in your Azure DevOps organization.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
continuationTokenNoContinuation token for pagination. Used to fetch the next set of results if available.
projectNameFilterNoFilter projects by name. Supports partial matches.
skipNoThe number of projects to skip for pagination. Defaults to 0.
stateFilterNoFilter projects by their state. Defaults to 'wellFormed'.wellFormed
topNoThe maximum number of projects to return. Defaults to 100.

Implementation Reference

  • Handler function that fetches projects from the Azure DevOps organization using the Core API, applies optional filtering and pagination, and returns the results as JSON or an error message.
    async ({ stateFilter, top, skip, continuationToken, projectNameFilter }) => { try { const connection = await connectionProvider(); const coreApi = await connection.getCoreApi(); const projects = await coreApi.getProjects(stateFilter, top, skip, continuationToken, false); if (!projects) { return { content: [{ type: "text", text: "No projects found" }], isError: true }; } const filteredProject = projectNameFilter ? filterProjectsByName(projects, projectNameFilter) : projects; return { content: [{ type: "text", text: JSON.stringify(filteredProject, null, 2) }], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : "Unknown error occurred"; return { content: [{ type: "text", text: `Error fetching projects: ${errorMessage}` }], isError: true, }; } }
  • Zod schema defining the input parameters for the core_list_projects tool.
    stateFilter: z.enum(["all", "wellFormed", "createPending", "deleted"]).default("wellFormed").describe("Filter projects by their state. Defaults to 'wellFormed'."), top: z.number().optional().describe("The maximum number of projects to return. Defaults to 100."), skip: z.number().optional().describe("The number of projects to skip for pagination. Defaults to 0."), continuationToken: z.number().optional().describe("Continuation token for pagination. Used to fetch the next set of results if available."), projectNameFilter: z.string().optional().describe("Filter projects by name. Supports partial matches."), },
  • Registration of the core_list_projects MCP tool on the server using server.tool(), including schema and handler.
    CORE_TOOLS.list_projects, "Retrieve a list of projects in your Azure DevOps organization.", { stateFilter: z.enum(["all", "wellFormed", "createPending", "deleted"]).default("wellFormed").describe("Filter projects by their state. Defaults to 'wellFormed'."), top: z.number().optional().describe("The maximum number of projects to return. Defaults to 100."), skip: z.number().optional().describe("The number of projects to skip for pagination. Defaults to 0."), continuationToken: z.number().optional().describe("Continuation token for pagination. Used to fetch the next set of results if available."), projectNameFilter: z.string().optional().describe("Filter projects by name. Supports partial matches."), }, async ({ stateFilter, top, skip, continuationToken, projectNameFilter }) => { try { const connection = await connectionProvider(); const coreApi = await connection.getCoreApi(); const projects = await coreApi.getProjects(stateFilter, top, skip, continuationToken, false); if (!projects) { return { content: [{ type: "text", text: "No projects found" }], isError: true }; } const filteredProject = projectNameFilter ? filterProjectsByName(projects, projectNameFilter) : projects; return { content: [{ type: "text", text: JSON.stringify(filteredProject, null, 2) }], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : "Unknown error occurred"; return { content: [{ type: "text", text: `Error fetching projects: ${errorMessage}` }], isError: true, }; } } );
  • Helper function used by the handler to filter projects by name.
    function filterProjectsByName(projects: ProjectInfo[], projectNameFilter: string): ProjectInfo[] { const lowerCaseFilter = projectNameFilter.toLowerCase(); return projects.filter((project) => project.name?.toLowerCase().includes(lowerCaseFilter)); }
  • src/tools.ts:20-20 (registration)
    Invocation of configureCoreTools which registers core tools including core_list_projects.
    configureCoreTools(server, tokenProvider, connectionProvider, userAgentProvider);

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