get_project
Retrieve detailed project information by providing its unique three-letter slug identifier to access specific project data.
Instructions
Retrieves detailed information about a specific project using its unique 'slug' (three uppercase letters, e.g., 'CRD').
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slug | Yes |
Implementation Reference
- src/tools/get-project.ts:100-132 (handler)The `execute` method implements the core handler logic for the `get_project` tool, fetching project details from the API via slug and returning structured data or error.async execute(input: GetProjectInput): Promise<unknown> { logger.info('Executing get-project tool', input); try { // Use the injected API client to get project by slug if (!this.apiClient) { throw new Error('API client not available - tool not properly initialized'); } const url = `/project/slug/${input.slug.toUpperCase()}`; logger.debug(`Making GET request to: ${url}`); const responseData = await this.apiClient.get<ProjectApiResponse>(url) as unknown as ProjectApiResponse; // Return project data according to the new schema return { slug: responseData?.slug || '', name: responseData?.name || '', description: responseData?.description || '', projectKnowledge: responseData?.projectKnowledge || {}, // Changed to camelCase projectDiagram: responseData?.projectDiagram || '', // Changed to camelCase projectStandards: responseData?.projectStandards || {} // Assuming project_standards is also camelCase from API }; } catch (error) { const errorMessage = (error instanceof Error) ? error.message : 'An unknown error occurred'; logger.error(`Error in get-project tool: ${errorMessage}`, error instanceof Error ? error : undefined); return { isError: true, content: [{ type: "text", text: errorMessage }] }; } }
- src/tools/get-project.ts:14-20 (schema)Zod input schema validation for the `get_project` tool, enforcing a required three-letter project slug.const GetProjectSchema = z.object({ // Project slug (URL-friendly identifier) slug: z.string({ required_error: "Project slug is required" }) .regex(/^[A-Za-z]{3}$/, { message: "Project slug must be three letters (e.g., CRD or crd). Case insensitive." }), }).strict();
- src/index.ts:315-330 (registration)Tool instantiation (`new GetProjectTool`) and registration with MCP server via `tool.register(server)` in the production server setup.const tools: any[] = [ new StartProjectTool(secureApiClient), new GetPromptTool(secureApiClient), new GetTaskTool(secureApiClient), new GetProjectTool(secureApiClient), new UpdateTaskTool(secureApiClient), new UpdateProjectTool(secureApiClient), new ListProjectsTool(secureApiClient), new ListTasksTool(secureApiClient), new NextTaskTool(secureApiClient), ]; // Register each tool with the server tools.forEach(tool => { tool.register(server); });
- src/tools/get-project.ts:50-68 (schema)MCP tool definition including input schema, used for tool registration and discovery.getMCPToolDefinition(): MCPToolDefinition { return { name: this.name, description: this.description, annotations: this.annotations, inputSchema: { type: "object", properties: { slug: { type: "string", pattern: "^[A-Za-z]{3}$", description: "The unique three-letter identifier for the project (e.g., 'CRD' or 'crd'). Case insensitive - will be converted to uppercase." } }, required: ["slug"], additionalProperties: false } }; }
- src/index.ts:25-25 (registration)Import of the GetProjectTool class required for instantiation and registration.import { GetProjectTool } from './tools/get-project.js';