Skip to main content
Glama
cremich

promptz.dev MCP Server

by cremich

get_prompt

Retrieve specific prompts by ID or name from promptz.dev to reduce context switching in development workflows.

Instructions

Get a specific prompt by ID or name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoName of the prompt to retrieve

Implementation Reference

  • The primary handler function for the 'get_prompt' tool. It validates the input name, fetches the prompt using getPromptByName, constructs a response object, and serializes it to JSON for the tool result.
    export async function getPromptToolHandler(request: CallToolRequest): Promise<CallToolResult> {
      const name = request.params.arguments?.name as string | undefined;
    
      if (!name) {
        throw new Error("Prompt name is required");
      }
      const prompt = await getPromptByName(name);
      if (!prompt) {
        throw new Error(`Prompt not found: ${name}`);
      }
    
      const promptData = {
        name: prompt.name,
        description: prompt.description,
        tags: prompt.tags || [],
        author: prompt.author?.displayName,
        instruction: prompt.instruction,
        howto: prompt.howto || "",
      };
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(promptData, null, 2),
          },
        ],
      };
    }
  • src/index.ts:51-63 (registration)
    Tool registration in the ListToolsRequestHandler response. Defines the name, description, and input schema for 'get_prompt'.
    {
      name: "get_prompt",
      description: "Get a specific prompt by ID or name",
      inputSchema: {
        type: "object",
        properties: {
          name: {
            type: "string",
            description: "Name of the prompt to retrieve",
          },
        },
      },
    },
  • src/index.ts:111-113 (registration)
    Dispatch logic in the CallToolRequestHandler switch statement that routes 'get_prompt' calls to the getPromptToolHandler.
    case "get_prompt": {
      return await getPromptToolHandler(request);
    }
  • TypeScript interface defining the structure of a Prompt object, used in the tool's response formatting and GraphQL responses.
    export interface Prompt {
      id?: string;
      name: string;
      description: string;
      tags?: string[];
      instruction: string;
      sourceURL?: string;
      howto?: string;
      public?: boolean;
      author?: {
        displayName: string;
      };
      createdAt?: string;
      updatedAt?: string;
    }
  • Helper function that performs the GraphQL query to fetch a prompt by its name, handling errors and returning the Prompt object or null.
    export async function getPromptByName(name: string): Promise<Prompt | null> {
      try {
        logger.info(`[API] Getting prompt by name: ${name}`);
    
        // Search for prompts with the exact name
        const { data, error } = await client.query(
          gql`
            ${GET_PROMPT_BY_NAME}
          `,
          { name },
        );
    
        if (error) {
          throw error;
        }
    
        const prompts = data.listByName.items;
        if (prompts.length === 0) {
          return null;
        }
    
        let prompt = prompts[0];
    
        return prompt;
      } catch (error) {
        logger.error(`[Error] Failed to get prompt by name: ${error instanceof Error ? error.message : String(error)}`);
        throw new Error(`Failed to get prompt by name: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It states the tool retrieves a prompt but doesn't describe what happens if the prompt doesn't exist (e.g., error handling), authentication needs, rate limits, or the format of the returned prompt. For a retrieval 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 a single, efficient sentence with zero waste. It's front-loaded with the core action and resource, making it easy to parse. Every word earns its place, achieving optimal conciseness for the tool's purpose.

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

Completeness2/5

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

Given the tool's simplicity (1 parameter, 100% schema coverage) but lack of annotations and output schema, the description is incomplete. It doesn't explain the return value (e.g., prompt content or metadata), error conditions, or behavioral nuances. For a retrieval tool, this leaves the agent without key operational context.

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

Parameters3/5

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

Schema description coverage is 100%, with the single parameter 'name' documented as 'Name of the prompt to retrieve'. The description adds that retrieval can be by 'ID or name', implying an alternative identifier not in the schema, but doesn't clarify how to specify an ID versus a name or if both are supported. This adds marginal value beyond the schema, meeting the baseline for high coverage.

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 action ('Get') and resource ('a specific prompt'), specifying retrieval by ID or name. It distinguishes from 'list_prompts' (which likely lists multiple prompts) but doesn't explicitly differentiate from 'get_rule' or 'list_rules', which operate on different resource types. The purpose is clear but sibling differentiation is incomplete.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention when to choose 'get_prompt' over 'list_prompts' (e.g., for detailed vs. summary views) or how it relates to 'get_rule' and 'list_rules'. Usage context is implied by the name but not explicitly stated, leaving gaps for the agent.

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/cremich/promptz-mcp'

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