Skip to main content
Glama
promptingbox

PromptingBox MCP Server

by promptingbox

list_versions

Retrieve version history for AI prompts, showing saved versions with version numbers, notes, and timestamps to track changes.

Instructions

Get the version history for a prompt. Shows all saved versions with their version numbers, notes, and timestamps.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptIdNoThe prompt ID. Provide this or promptTitle.
promptTitleNoThe prompt title to search for. Provide this or promptId.

Implementation Reference

  • Tool registration and handler for 'list_versions' that resolves the prompt ID, calls the API client to fetch versions, formats the output, and returns the version history as text.
    server.tool(
      'list_versions',
      'Get the version history for a prompt. Shows all saved versions with their version numbers, notes, and timestamps.',
      {
        promptId: z.string().optional().describe('The prompt ID. Provide this or promptTitle.'),
        promptTitle: z.string().optional().describe('The prompt title to search for. Provide this or promptId.'),
      },
      async ({ promptId, promptTitle }) => {
        try {
          const resolved = await resolvePromptId(promptId, promptTitle);
          if ('error' in resolved) return errorResult(resolved.error);
    
          const [versions, suffix] = await Promise.all([
            client.listVersions(resolved.id),
            getResponseSuffix(),
          ]);
    
          if (versions.length === 0) {
            return {
              content: [{ type: 'text' as const, text: `No versions found.\n\n${suffix}` }],
            };
          }
    
          const lines = versions.map((v) =>
            `- **v${v.versionNumber}** — ${v.versionNote ?? 'No note'} (${new Date(v.createdAt).toLocaleDateString()})`
          );
    
          return {
            content: [{
              type: 'text' as const,
              text: `Version history (${versions.length} version${versions.length === 1 ? '' : 's'}):\n\n${lines.join('\n')}\n\n${suffix}`,
  • PromptVersion interface defining the structure of version objects returned by the listVersions API call, including id, versionNumber, title, content, versionNote, and createdAt fields.
    export interface PromptVersion {
      id: string;
      versionNumber: number;
      title: string;
      content: string;
      versionNote: string | null;
      createdAt: string;
    }
  • API client method listVersions that makes an HTTP GET request to the /api/mcp/prompt/{promptId}/version endpoint and returns an array of PromptVersion objects.
    async listVersions(promptId: string): Promise<PromptVersion[]> {
      return this.request<PromptVersion[]>(`/api/mcp/prompt/${promptId}/version`);
    }
  • resolvePromptId helper function that resolves a prompt ID from either an explicit ID or a title search. Used by the list_versions handler to find the correct prompt.
    async function resolvePromptId(promptId?: string, promptTitle?: string): Promise<
      { id: string } | { error: string }
    > {
      if (promptId) return { id: promptId };
      if (!promptTitle) return { error: 'Provide either promptId or promptTitle.' };
    
      const all = await client.listPrompts();
      const lower = promptTitle.toLowerCase();
      const matches = all.filter((p) => p.title.toLowerCase().includes(lower));
    
      if (matches.length === 0) return { error: `No prompt found matching "${promptTitle}".` };
      if (matches.length > 1) {
        const list = matches.map((p) => `- ${p.title} (id: ${p.id})`).join('\n');
        return { error: `Multiple prompts match "${promptTitle}". Use promptId to be specific:\n${list}` };
      }
      return { id: matches[0].id };
    }
Behavior3/5

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

With no annotations provided, the description carries full burden. It clearly indicates this is a read operation ('Get', 'Shows') and specifies the scope of returned data. However, it doesn't disclose behavioral aspects like pagination, sorting order, error conditions, or authentication requirements that would be helpful for an agent.

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 perfectly concise with two sentences that each earn their place. The first sentence states the core action and resource, while the second elaborates on what information is returned. No wasted words, and the most important information is front-loaded.

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?

For a read-only tool with 2 parameters and 100% schema coverage but no output schema, the description provides adequate context about what the tool does and returns. However, without annotations or output schema, it lacks information about return format structure, error handling, and other behavioral details that would make it more complete.

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%, so the schema already documents both parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema descriptions. It implies the tool needs either a promptId or promptTitle but doesn't elaborate on format, validation, or search behavior.

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 ('Get the version history') and resource ('for a prompt'), distinguishing it from siblings like get_prompt (which retrieves current version) or restore_version (which modifies state). It specifies what information is returned ('all saved versions with their version numbers, notes, and timestamps'), 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 implies usage context by specifying 'for a prompt' and listing what information is returned, but doesn't explicitly state when to use this versus alternatives like get_prompt (for current version) or restore_version (to revert to a specific version). It provides clear context about the tool's function but lacks explicit comparison or exclusion guidance.

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/promptingbox/mcp'

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