list_projects
Retrieve all projects within a specified Azure DevOps organization to manage and organize development work across teams.
Instructions
Lists all projects in an Azure DevOps organization
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| organization | Yes | The name of the Azure DevOps organization |
Implementation Reference
- src/tools/organizations.ts:24-38 (handler)The handler function for the 'list_projects' tool. It retrieves the connection for the specified organization, gets the Core API, fetches the projects, and returns them as JSON text or an error message.async ({ organization }) => { try { const connection = await connectionManager.getConnection(organization); const coreApi = await connection.getCoreApi(); const projects = await coreApi.getProjects(); return { content: [{ type: "text", text: JSON.stringify(projects, null, 2) }], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } }
- src/tools/organizations.ts:21-23 (schema)Input schema for the 'list_projects' tool, requiring an 'organization' string parameter.{ organization: z.string().describe("The name of the Azure DevOps organization"), },
- src/tools/organizations.ts:18-39 (registration)Direct registration of the 'list_projects' tool using server.tool() within the registerOrganizationTools function.server.tool( "list_projects", "Lists all projects in an Azure DevOps organization", { organization: z.string().describe("The name of the Azure DevOps organization"), }, async ({ organization }) => { try { const connection = await connectionManager.getConnection(organization); const coreApi = await connection.getCoreApi(); const projects = await coreApi.getProjects(); return { content: [{ type: "text", text: JSON.stringify(projects, null, 2) }], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } } );
- src/tools/index.ts:8-8 (registration)Higher-level registration call to registerOrganizationTools from the main tools index, which includes the 'list_projects' tool.registerOrganizationTools(server, connectionManager);