Skip to main content
Glama

start_project

Retrieve project details and initial task prompt using a project slug to begin work or understand starting requirements.

Instructions

Retrieves the project details and the prompt for the very first task of a specified project using the project's unique slug (e.g., 'CRD'). This is useful for initiating work on a new project or understanding its starting point.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slugYes

Implementation Reference

  • Core handler function that executes the tool: calls API for first task of project by slug, sets up git repo, returns structured response with project/task/git info.
    async execute(input: StartProjectInput): Promise<unknown> {
      logger.info('Executing start-project tool', input);
    
      try {
        // Use the injected API client to get first task
        if (!this.apiClient) {
          throw new Error('API client not available - tool not properly initialized');
        }
    
        // Get the first task of the project using the new endpoint
        const url = `/project/slug/${input.slug.toUpperCase()}/first-task`;
        logger.debug(`Making GET request to: ${url}`);
        
        const responseData = await this.apiClient.get<StartProjectApiResponse>(url) as unknown as StartProjectApiResponse;
        // const responseData: StartProjectApiResponse = axiosResponse.data; // This was the previous incorrect line
        
        if (!responseData || responseData.error) { 
          const errorMessage = responseData?.error || `Failed to get first task for project '${input.slug}' (no data or error in response).`;
          logger.warn(`Error in start-project tool: ${errorMessage}`, { responseData });
          return {
            isError: true,
            content: [{ type: "text", text: errorMessage }]
          };
        }
        
        // Git integration: Set up repository if needed
        const gitSetupResult = await this.setupGitRepository(responseData.project);
        
        // Return data structured according to the new schema with git setup status
        return {
          project: {
            slug: responseData.project?.slug || '',
            name: responseData.project?.name || ''
          },
          task: {
            number: responseData.task?.number || '',
            title: responseData.task?.title || '',
            prompt: responseData.task?.prompt || '' // Access 'prompt' and output as 'prompt'
          },
          gitSetup: gitSetupResult
        };
      } catch (error) {
        const errorMessage = (error instanceof Error) ? error.message : 'An unknown error occurred';
        logger.error(`Error in start-project tool: ${errorMessage}`, error instanceof Error ? error : undefined);
        
        return {
          isError: true,
          content: [{ type: "text", text: errorMessage }]
        };
      }
    }
  • Zod input schema requiring a three-letter project slug.
    const StartProjectSchema = 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." })
      .describe("Project slug identifier (e.g., 'CRD' or 'crd'). Case insensitive"),
    }).strict();
  • src/index.ts:315-330 (registration)
    Registration: instantiates StartProjectTool with SecureApiClient and registers it (along with other tools) to the MCP server.
    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);
    });
  • Helper function to initialize git repository for the project if not already present.
    private async setupGitRepository(projectData: any): Promise<{ status: string; message: string; actions: string[] }> {
      try {
        const projectSlug = projectData?.slug;
        const projectName = projectData?.name || projectSlug;
        
        // Check if we're in a git repository
        const { execSync } = await import('child_process');
        
        try {
          execSync('git rev-parse --git-dir', { stdio: 'ignore' });
          // Already in a git repository
          return {
            status: 'existing',
            message: 'Git repository already exists',
            actions: [
              'Verified existing git repository',
              'Ready for project development',
              'Consider creating feature branch for project work'
            ]
          };
        } catch {
          // Not in a git repository, initialize one
          try {
            execSync('git init', { stdio: 'ignore' });
            execSync('git add .', { stdio: 'ignore' });
            execSync(`git commit -m "feat: initialize ${projectName} project (${projectSlug})"`, { stdio: 'ignore' });
            
            return {
              status: 'initialized',
              message: 'Git repository initialized successfully',
              actions: [
                'Initialized new git repository',
                'Created initial commit for project',
                'Ready for feature branch creation',
                'Consider setting up remote repository'
              ]
            };
          } catch (gitError) {
            return {
              status: 'failed',
              message: `Git initialization failed: ${gitError}`,
              actions: [
                'Manual git setup required',
                'Run: git init',
                'Run: git add .',
                'Run: git commit -m "feat: initialize project"'
              ]
            };
          }
        }
      } catch (error) {
        return {
          status: 'error',
          message: `Git setup error: ${error}`,
          actions: [
            'Git not available or accessible',
            'Install git if needed',
            'Verify git is in PATH'
          ]
        };
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It describes the retrieval action but lacks details on permissions, rate limits, error handling, or response format. For a tool with no annotation coverage, this leaves significant gaps in understanding how it behaves beyond the basic operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured in two sentences: the first states the action and parameters, and the second explains the usage context. Every sentence adds value without redundancy, making it easy to parse and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (retrieving specific project data), no annotations, and no output schema, the description is adequate but incomplete. It covers the purpose and usage well but lacks behavioral details like response format or error conditions, which are important for an agent to use it effectively in a broader context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful context for the single parameter ('slug'), explaining it as a 'unique slug (e.g., 'CRD')' and specifying its use for identifying the project. With 0% schema description coverage, this compensates well by providing practical examples and clarifying the parameter's role, though it does not detail the pattern constraints (e.g., three letters) beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Retrieves') and resources ('project details and the prompt for the very first task'), distinguishing it from siblings like 'get_project' (general project details) and 'get_prompt' (general prompt retrieval). It specifies the scope ('very first task') and input mechanism ('using the project's unique slug'), making the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool ('initiating work on a new project or understanding its starting point'), which implicitly differentiates it from siblings like 'next_task' (for subsequent tasks) or 'list_projects' (for overviews). However, it does not explicitly state when not to use it or name alternatives, such as using 'get_project' for general details without the first task prompt.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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