Skip to main content
Glama

get_prompt

Retrieve detailed task instructions by task number to understand requirements for AI agent execution.

Instructions

Retrieves the specific instructions or prompt for a given task, identified by its unique task number (e.g., 'CRD-1'). This is typically used to understand the detailed requirements or context for an AI agent to work on the task.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numberYes

Implementation Reference

  • The main handler function that executes the tool logic: validates input, calls the CodeRide API to fetch the task prompt for the given task number, and returns the prompt or handles errors.
    async execute(input: GetPromptInput): Promise<unknown> {
      logger.info('Executing get-prompt tool', input);
    
      try {
        // Use the injected API client to get task prompt
        if (!this.apiClient) {
          throw new Error('API client not available - tool not properly initialized');
        }
    
        // Get the task prompt using the specific endpoint /task/number/:taskNumber/prompt
        const taskNumber = input.number.toUpperCase(); // Convert to uppercase for consistency
        const url = `/task/number/${taskNumber}/prompt`; 
        logger.debug(`Making GET request to: ${url}`);
        
        const responseData = await this.apiClient.get<TaskApiResponse>(url) as unknown as TaskApiResponse;
        
        if (!responseData) { 
          logger.warn(`No response data received for task number ${taskNumber} from ${url}. This might indicate the task has no prompt or an API issue.`);
          return { taskPrompt: '' }; // Output camelCase, return empty if no data
        }
        
        // User confirmed API returns 'taskPrompt' (camelCase) for this endpoint.
        // TaskApiResponse interface has been updated accordingly.
        return {
          taskPrompt: responseData.taskPrompt || '' // Access camelCase, output camelCase
        };
    
      } catch (error) {
        const errorMessage = (error instanceof Error) ? error.message : 'An unknown error occurred';
        logger.error(`Error in get-prompt tool: ${errorMessage}`, error instanceof Error ? error : undefined);
        
        return {
          isError: true,
          content: [{ type: "text", text: errorMessage }]
        };
      }
    }
  • Zod schema defining the input for the get_prompt tool: requires a 'number' string matching the task ID format (e.g., CRD-1).
    const GetPromptSchema = z.object({
      // Task number (e.g., "CRD-1")
      number: z.string({
        required_error: "Task number is required"
      }).regex(/^[A-Za-z]{3}-\d+$/, { message: "Task number must be in the format ABC-123 (e.g., CRD-1 or crd-1). Case insensitive." }),
    }).strict();
  • src/index.ts:315-330 (registration)
    Instantiation of the GetPromptTool with SecureApiClient dependency injection and registration to the MCP server via the tools array and forEach register call.
    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);
    });
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a retrieval operation, implying read-only behavior, but doesn't cover critical aspects like error handling (e.g., what happens if the task number doesn't exist), authentication needs, rate limits, or response format. For a tool with zero annotation coverage, this is a significant gap in transparency.

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 core functionality, and the second adds usage context. Every phrase earns its place without redundancy, making it easy to parse and front-loaded with essential information. No wasted words.

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 low complexity (single parameter, no output schema, no annotations), the description is adequate but incomplete. It covers purpose and parameter meaning well, but lacks details on behavioral traits like error handling or return values. Without annotations or output schema, more context on what to expect would improve completeness for safe agent use.

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 by explaining that 'number' refers to a 'unique task number' with an example format ('e.g., "CRD-1"'), which complements the schema's pattern constraint. With 0% schema description coverage and only one parameter, this effectively compensates, providing clear semantic understanding beyond the bare schema.

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

Purpose4/5

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

The description clearly states the tool's purpose with specific verbs ('retrieves', 'understand') and identifies the resource ('instructions or prompt for a given task'). It distinguishes from siblings like get_task or list_tasks by focusing on prompt content rather than task metadata. However, it doesn't explicitly contrast with all siblings, keeping it at 4 instead of 5.

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

Usage Guidelines3/5

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

The description implies usage context ('typically used to understand detailed requirements or context for an AI agent to work on the task'), suggesting when to use it. However, it doesn't provide explicit guidance on when to choose this over alternatives like get_task or next_task, nor does it mention exclusions or prerequisites. This leaves usage somewhat ambiguous.

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