get_project
Retrieve detailed information about a specific project in Azure DevOps using the project ID or name, enabling streamlined access to project data through the MCP server.
Instructions
Get details of a specific project
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | The ID or name of the project |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"projectId": {
"description": "The ID or name of the project",
"type": "string"
}
},
"required": [
"projectId"
],
"type": "object"
}
Implementation Reference
- The main handler function that executes the tool logic: retrieves the project details from Azure DevOps Core API using the project ID or name, handles errors appropriately.export async function getProject( connection: WebApi, projectId: string, ): Promise<TeamProject> { try { const coreApi = await connection.getCoreApi(); const project = await coreApi.getProject(projectId); if (!project) { throw new AzureDevOpsResourceNotFoundError( `Project '${projectId}' not found`, ); } return project; } catch (error) { if (error instanceof AzureDevOpsError) { throw error; } throw new Error( `Failed to get project: ${error instanceof Error ? error.message : String(error)}`, ); } }
- Zod schema defining the input parameters for the get_project tool: optional projectId and organizationId with descriptions.export const GetProjectSchema = z.object({ projectId: z .string() .optional() .describe(`The ID or name of the project (Default: ${defaultProject})`), organizationId: z .string() .optional() .describe(`The ID or name of the organization (Default: ${defaultOrg})`), });
- src/features/projects/tool-definitions.ts:18-22 (registration)Tool definition registration for the 'get_project' MCP tool, including name, description, and input schema.{ name: 'get_project', description: 'Get details of a specific project', inputSchema: zodToJsonSchema(GetProjectSchema), },
- src/features/projects/index.ts:62-70 (registration)Request handler registration in the projects feature router: parses arguments with schema and invokes the getProject handler.case 'get_project': { const args = GetProjectSchema.parse(request.params.arguments); const result = await getProject( connection, args.projectId ?? defaultProject, ); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], };