Skip to main content
Glama

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
NameRequiredDescriptionDefault
slugYes

Implementation Reference

  • 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 }]
        };
      }
    }
  • 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);
    });
  • 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';

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/PixdataOrg/coderide-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server