list_projects
Retrieve a list of all accessible projects within an Azure DevOps organization to manage and organize development workflows effectively.
Instructions
List all accessible projects in the Azure DevOps organization
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"required": [],
"type": "object"
}
Implementation Reference
- src/tools/projects.ts:14-39 (handler)The main handler function that parses input, fetches projects using coreClient.getProjects(), and returns them as JSON text content.export async function listProjects(rawParams: any) { // Parse arguments const params = listProjectsSchema.parse(rawParams); console.error("[API] Listing projects"); try { // Get the Core API client const coreClient = await getCoreClient(); // Get projects const projects = await coreClient.getProjects(); return { content: [ { type: "text", text: JSON.stringify(projects, null, 2), }, ], }; } catch (error) { logError("Error listing projects", error); throw error; } }
- src/schemas/projects.ts:6-8 (schema)Zod schema for list_projects input parameters (empty object) and inferred TypeScript type.export const listProjectsSchema = z.object({}); export type ListProjectsParams = z.infer<typeof listProjectsSchema>;
- src/tools/projects.ts:95-103 (registration)Tool registration metadata including name, description, and input schema, part of the projectTools array exported for server use.name: "list_projects", description: "List all accessible projects in the Azure DevOps organization", inputSchema: { type: "object", properties: {}, required: [], }, },
- src/index.ts:97-98 (registration)Dispatch case in the main CallToolRequest handler that invokes the listProjects function.case "list_projects": return await listProjects(request.params.arguments || {});