Skip to main content
Glama

list_projects

Retrieve all projects in an Azure DevOps organization with flexible filtering options, including state, pagination, and maximum results, to manage and organize project data efficiently.

Instructions

List all projects in an organization

Input Schema

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

Implementation Reference

  • The core handler function that lists Azure DevOps projects using the Core API's getProjects method.
    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 defining the input parameters for 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 reference.
    name: 'list_projects', description: 'List all projects in an organization', inputSchema: zodToJsonSchema(ListProjectsSchema), },
  • Request handler dispatcher that parses arguments and invokes 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