Skip to main content
The list_prompts tool returns a paginated list of prompt metadata (without full content) for all prompts visible to the authenticated caller or public prompts for anonymous callers.

Access Control

  • Authenticated users: Returns their own prompts (public or private) plus all public prompts from other users
  • Anonymous callers: Returns only public prompts
  • Archived prompts: Always excluded from results

Parameters

limit
integer
default:20
Number of prompts to return per page. Must be between 1 and 100.
offset
integer
default:0
Number of prompts to skip (for pagination). Must be >= 0.

Response

Returns a ListPromptsResult object containing an array of prompt entries.
prompts
array
Array of prompt metadata objects
id
string
Unique UUID identifier for the prompt
title
string
Prompt title
description
string | null
Optional description of the prompt
variables
string[]
Array of variable names extracted from the prompt content using {{variable}} syntax

Examples

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "list_prompts",
    "arguments": {
      "limit": 10,
      "offset": 0
    }
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "prompts": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "title": "Code Review Template",
        "description": "Template for reviewing pull requests",
        "variables": ["language", "pr_url", "focus_area"]
      },
      {
        "id": "660e8400-e29b-41d4-a716-446655440001",
        "title": "Bug Report Assistant",
        "description": null,
        "variables": ["error_message", "stack_trace"]
      }
    ]
  }
}

Implementation Details

  • Results are ordered by updated_at descending (most recently updated first)
  • Variables are automatically extracted from the latest version of each prompt
  • The tool uses the extractVariables() utility which matches {{variable}} patterns
  • Pagination is implemented using SQL RANGE for efficient offset/limit queries

Error Codes

-32602
INVALID_PARAMS
Parameters failed validation (e.g., limit out of range, negative offset)
-32603
INTERNAL_ERROR
Database query failed or other internal error occurred

Build docs developers (and LLMs) love