Skip to main content
Glama

list_projects

Retrieve all Azure DevOps projects in an organization with filtering options for state, pagination, and continuation tokens to manage large project lists.

Instructions

List all projects in an organization

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
organizationIdNoThe ID or name of the organization (Default: mycompany)
stateFilterNoFilter on team project state (0: all, 1: well-formed, 2: creating, 3: deleting, 4: new)
topNoMaximum number of projects to return
skipNoNumber of projects to skip
continuationTokenNoGets the projects after the continuation token provided

Implementation Reference

  • The core handler function that lists Azure DevOps projects using the Core API, handling options and errors.
    export async function listProjects( connection: WebApi, options: ListProjectsOptions = {}, ): Promise<TeamProject[]> { try { const coreApi = await connection.getCoreApi(); const projects = await coreApi.getProjects( options.stateFilter, options.top, options.skip, options.continuationToken, ); return projects; } catch (error) { if (error instanceof AzureDevOpsError) { throw error; } throw new Error( `Failed to list projects: ${error instanceof Error ? error.message : String(error)}`, ); } }
  • Zod schema for validating input parameters to the list_projects tool.
    export const ListProjectsSchema = z.object({ organizationId: z .string() .optional() .describe(`The ID or name of the organization (Default: ${defaultOrg})`), stateFilter: z .number() .optional() .describe( 'Filter on team project state (0: all, 1: well-formed, 2: creating, 3: deleting, 4: new)', ), top: z.number().optional().describe('Maximum number of projects to return'), skip: z.number().optional().describe('Number of projects to skip'), continuationToken: z .number() .optional() .describe('Gets the projects after the continuation token provided'), });
  • Tool definition registration including name, description, and input schema for the list_projects tool.
    name: 'list_projects', description: 'List all projects in an organization', inputSchema: zodToJsonSchema(ListProjectsSchema), },
  • Request handler dispatch case that parses arguments with schema and calls the listProjects handler.
    case 'list_projects': { const args = ListProjectsSchema.parse(request.params.arguments); const result = await listProjects(connection, { stateFilter: args.stateFilter, top: args.top, skip: args.skip, continuationToken: args.continuationToken, }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }

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/Tiberriver256/mcp-server-azure-devops'

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