# PromptLayer — how to use (mcp.ai)

Connect your PromptLayer account and use 16 tools for artificial intelligence straight from your AI agent. Connect with your own API key. PromptLayer is a prompt management and observability platform for versioning, evaluating, running, and analyzing LLM applications.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_promptlayer?ms=1787295840000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `promptlayer_get_prompt_template`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/promptlayer`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/promptlayer/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/promptlayer/get/prompt/template` — Retrieve a prompt template version, release label, messages, model metadata, snippets, and optionally provider-ready kwargs without executing it.
  - body: { label?: string, version?: integer, identifier: string, resolve_snippets?: boolean, include_llm_kwargs?: boolean }
- `POST https://api.mcp.ai/api/promptlayer/get/registered/tool` — Retrieve a PromptLayer registered tool definition by ID or name at a selected version or release label without test execution.
  - body: { label?: string, version?: string, identifier: string }
- `POST https://api.mcp.ai/api/promptlayer/get/request/log` — Retrieve one PromptLayer request log with its recorded input, output, timing, usage, metadata, tags, and scores.
  - body: { request_id: integer }
- `POST https://api.mcp.ai/api/promptlayer/get/skill/collection` — Retrieve a PromptLayer skill collection and its files as JSON at a selected version or release label.
  - body: { label?: string, version?: integer, identifier: string }
- `POST https://api.mcp.ai/api/promptlayer/get/table` — Retrieve one PromptLayer Table's metadata and per-sheet row counts by UUID.
  - body: { table_id: string }
- `POST https://api.mcp.ai/api/promptlayer/get/workflow` — Retrieve a PromptLayer workflow definition by ID or name at a specific version or release label without running it.
  - body: { label?: string, version?: integer, workflow_id_or_name: string }
- `POST https://api.mcp.ai/api/promptlayer/list/folder/entities` — Browse or search PromptLayer folders and registry entities in the API-key workspace, optionally recursively and with metadata.
  - body: { tags?: string[], flatten?: boolean, sort_by?: string, folder_id?: integer, sort_order?: string, external_id?: string, filter_types?: string[], search_query?: string, external_source?: string, created_by_email?: string, include_metadata?: boolean }
- `POST https://api.mcp.ai/api/promptlayer/list/prompt/templates` — Search and page through PromptLayer prompt templates and snippets without executing a model.
  - body: { name?: string, tags?: string[], label?: string, status?: string, sort_by?: string, per_page?: integer, is_snippet?: boolean, sort_order?: string, external_id?: string, next_cursor?: string, created_after?: string, updated_after?: string, created_before?: string, updated_before?: string, external_source?: string, created_by_email?: string }
- `POST https://api.mcp.ai/api/promptlayer/list/registered/tools` — List and filter tools defined in PromptLayer's tool registry without executing them.
  - body: { sort_by?: string, sort_order?: string, external_id?: string, created_after?: string, updated_after?: string, created_before?: string, updated_before?: string, external_source?: string, created_by_email?: string }
- `POST https://api.mcp.ai/api/promptlayer/list/skill/collections` — List and filter PromptLayer skill collections available in the API-key workspace.
  - body: { sort_by?: string, sort_order?: string, external_id?: string, created_after?: string, updated_after?: string, created_before?: string, updated_before?: string, external_source?: string, created_by_email?: string }
- `POST https://api.mcp.ai/api/promptlayer/list/table/columns` — List one page of user and optionally system columns for a PromptLayer Table sheet.
  - body: { limit?: integer, sheet_id: string, table_id: string, next_cursor?: string, include_system_columns?: boolean }
- `POST https://api.mcp.ai/api/promptlayer/list/table/rows` — Read one page of rows and cells from a PromptLayer Table sheet, with optional schema and execution aggregates.
  - body: { limit?: integer, order?: string, sheet_id: string, table_id: string, next_cursor?: string, include_columns?: boolean, include_row_count?: boolean, include_system_columns?: boolean, include_execution_metadata_aggregates?: boolean }
- `POST https://api.mcp.ai/api/promptlayer/list/table/sheets` — List one page of sheets in a PromptLayer Table, optionally filtering by referenced prompt.
  - body: { limit?: integer, order?: string, table_id: string, prompt_id?: integer, next_cursor?: string, prompt_label_id?: integer, prompt_version_id?: integer }
- `POST https://api.mcp.ai/api/promptlayer/list/tables` — Search and page through PromptLayer Tables by folder, name, or referenced prompt.
  - body: { name?: string, limit?: integer, order?: string, folder_id?: integer, prompt_id?: integer, next_cursor?: string, prompt_label_id?: integer, prompt_version_id?: integer }
- `POST https://api.mcp.ai/api/promptlayer/list/workflows` — Search and page through PromptLayer workflows without running them.
  - body: { sort_by?: string, per_page?: integer, sort_order?: string, external_id?: string, next_cursor?: string, created_after?: string, updated_after?: string, created_before?: string, updated_before?: string, external_source?: string, created_by_email?: string }
- `POST https://api.mcp.ai/api/promptlayer/search/request/logs` — Search PromptLayer request logs by text or structured filters and return one rate-limited page sorted by operational fields.
  - body: { query?: string, sort_by?: string, per_page?: integer, sort_order?: string, next_cursor?: string, filter_group?: object, include_prompt_name?: boolean }

## Example prompts
- "What can I do in PromptLayer?"
- "Show me a summary of my PromptLayer account"

## More
- Page: https://mcp.ai/promptlayer
- Agent spec (llms.txt): https://mcp.ai/promptlayer/llms.txt
- Postman collection: https://mcp.ai/promptlayer/postman.json
