PromptLayer MCP server for AI agents and assistants

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with PromptLayer MCP or direct API to version prompts, run evaluations, inspect request logs, and analyze LLM performance through natural language.

PromptLayer logoPromptLayer
Api Key

PromptLayer is a prompt management and observability platform for LLM apps. Use it to version prompts, run evaluations, trace requests, and analyze model behavior.

115 Tools

Try PromptLayer now

Type what you want done — sign in and watch it run live in the Tool Router playground.

TOOL ROUTER PLAYGROUND
PromptLayer
Try asking
TOOLS

Supported Tools

Every PromptLayer action and event your agent gets out of the box.

Add Table Rows

Append one or more rows to a PromptLayer Table sheet in the API key's workspace.

Attach Folder External ID

Attach an external-system identifier to an existing PromptLayer folder.

Attach Prompt Template External ID

Attach an external system identifier to an existing PromptLayer prompt template.

Attach Registered Tool External ID

Attach an external-system identifier to an existing PromptLayer registered tool.

Attach Skill Collection External ID

Attach an external system identifier to a PromptLayer skill collection by UUID.

Attach Workflow External ID

Attach an external-system identifier to an existing PromptLayer workflow.

Cancel Table Sheet Operation

Cancel an active PromptLayer Table sheet recalculation operation.

Cancel Table Sheet Scorecard

Cancel queued or running scorecard work for a PromptLayer table sheet.

Close Trace

Close a PromptLayer trace, permanently preventing further span ingestion for that trace through spans-bulk or OTLP /v1/traces.

Configure Table Sheet Score

Configure scoring for a PromptLayer Table sheet using columns, boolean or numeric scoring, or custom code.

Configure Table Sheet Scorecard

Create or update the active scorecard for a PromptLayer table sheet.

Create Folder

Create a PromptLayer folder at the workspace root or inside a parent folder, optionally attaching external identifiers.

Create Prompt Template Label

Create a release label for a specific version of a PromptLayer prompt template.

Create Registered Tool

Create a PromptLayer registered tool and its initial version in the API key's workspace using an OpenAI function-calling definition.

Create Registered Tool Environment Variable

Create an environment variable scoped to a registered PromptLayer tool, identified by numeric ID or name.

Create Registered Tool Version

Create a new version of an existing PromptLayer registered tool by numeric ID or name using an OpenAI function-calling definition.

Create Skill Collection

Create a PromptLayer skill collection in the API key's workspace, optionally with initial text files, a destination folder, provider, and external IDs.

Create Table

Create a PromptLayer Table in the API key's workspace, optionally in a folder.

Create Table Column

Add a column to a PromptLayer Table sheet in the API key's workspace.

Create Table Sheet

Create a sheet in a PromptLayer Table in the API key's workspace.

Create Table Sheet Operation

Queue recalculation of a PromptLayer Table sheet, optionally selecting columns, zero-based rows, and cell statuses.

Create Table Sheet Version

Create a named snapshot of a PromptLayer Table sheet, or restore an existing version while creating a new version.

Create Workflow

Create a PromptLayer workflow, or a new version of an existing workflow.

Create Workspace Environment Variable

Create a workspace environment variable in the API key's workspace.

Delete Folder Entities

Delete PromptLayer registry entities by ID and type.

Delete Folder External ID

Detach an external identifier from a PromptLayer folder using its folder ID, source namespace, and external ID value.

Delete Prompt Template External ID

Detach an external identifier from a PromptLayer prompt template using its template ID, source namespace, and external ID value.

Delete Prompt Template Label

Delete a PromptLayer prompt template release label by its label ID.

Delete registered tool environment variable

Delete one tool-scoped environment variable from a PromptLayer registered tool identified by its ID or name.

Delete Registered Tool External ID

Detach an external identifier from a PromptLayer registered tool using its tool ID, source namespace, and external ID value.

Delete Skill Collection External ID

Detach one external ID mapping from a PromptLayer skill collection by its UUID, source, and external ID.

Delete Table

Soft delete a PromptLayer Table by UUID, removing it from active list responses.

Delete Table Column

Delete a column and its cells from a PromptLayer Table sheet.

Delete Table Sheet

Soft delete a sheet from a PromptLayer Table, removing it from active sheet list responses.

Delete Table Sheet Scorecard

Soft-delete the active scorecard for a PromptLayer table sheet.

Delete Workflow External ID

Detach an external identifier from a PromptLayer workflow using its workflow ID, source namespace, and external ID value.

Delete workspace environment variable

Delete a PromptLayer workspace environment variable by its integer ID.

Get Prompt Snippet Usage

Get the prompts, version numbers, and labels using a prompt-template snippet by name or numeric ID.

Get Prompt Template

Retrieve a prompt template version, release label, messages, model metadata, snippets, and optionally provider-ready kwargs without executing it.

Get Registered Tool

Retrieve a PromptLayer registered tool definition by ID or name at a selected version or release label without test execution.

Get Request Analytics

Read aggregated PromptLayer request-log analytics, including costs, tokens, latency percentiles, time series, and usage breakdowns.

Get Request Log

Retrieve one PromptLayer request log with its recorded input, output, timing, usage, metadata, tags, and scores.

Get Request Search Suggestions

Get autocomplete suggestions for a PromptLayer request-log search field.

Get Skill Collection

Retrieve a PromptLayer skill collection and its files as JSON at a selected version or release label.

Get Table

Retrieve one PromptLayer Table's metadata and per-sheet row counts by UUID.

Get Table Cell

Retrieve a single cell by UUID from a PromptLayer Table sheet.

Get Table Scorecard Calculation

Get a single scorecard calculation for a PromptLayer table sheet by its calculation UUID.

Get Table Scorecard Row

Get the row-level scorecard breakdown for a zero-based row index in a PromptLayer table sheet, including aggregate score, verdict, step results, and drift or staleness metadata.

Get Table Sheet

Get metadata for one sheet in a PromptLayer Table, including its row count, display order, and current version.

Get Table Sheet Import Operation

Poll the status of an asynchronous PromptLayer Table sheet import using its operation ID.

Get Table Sheet Operation

Poll a PromptLayer Table sheet recalculation operation by its operation ID.

Get Table Sheet Score

Retrieve the current score payload for a PromptLayer table sheet, including calculation status, scoring configuration, per-column results, and aggregate scores.

Get Table Sheet Scorecard

Get the active scorecard for a PromptLayer table sheet, including its evaluation steps, latest and display calculation metadata, summaries, and progress.

Get Table Sheet Score History

Retrieve score-history points across saved versions of a PromptLayer table sheet, with optional history range, resolution, and maximum point count.

Get Table Sheet Version

Retrieve one saved PromptLayer Table sheet version, including its snapshot and recorded changes.

Get Trace

Retrieve a PromptLayer trace by its trace ID, including its spans and any associated request-log IDs.

Get Workflow

Retrieve a PromptLayer workflow definition by ID or name at a specific version or release label without running it.

Get Workflow Execution Results

Retrieve results of an already-started PromptLayer workflow execution.

Import Table Sheet File

Start an asynchronous CSV import into an existing PromptLayer Table sheet.

Import Request Logs Into Table Sheet

Start an asynchronous request-history import into an existing PromptLayer Table sheet.

Ingest OTLP Traces

Ingest OpenTelemetry traces using OTLP JSON, optionally gzip-compressed.

Ingest Spans

Persist a batch of OpenTelemetry-style observability spans and optional associated request logs in PromptLayer without invoking a model.

List Folder Entities

Browse or search PromptLayer folders and registry entities in the API-key workspace, optionally recursively and with metadata.

List Folder External IDs

List all external identifier mappings attached to a PromptLayer folder by its folder ID.

List Prompt Template External IDs

List all external system identifiers attached to a PromptLayer prompt template by its numeric ID.

List Prompt Template Labels

List all release labels for a prompt template by name or numeric ID, including each label's associated version ID and version number.

List Prompt Templates

Search and page through PromptLayer prompt templates and snippets without executing a model.

List Registered Tool Environment Variables

List environment variables for a PromptLayer registered tool by ID or name.

List Registered Tool External IDs

List all external identifier mappings attached to a registered PromptLayer tool by its tool ID.

List Registered Tools

List and filter tools defined in PromptLayer's tool registry without executing them.

List Skill Collection External IDs

List all external system identifier mappings attached to a PromptLayer skill collection by UUID.

List Skill Collections

List and filter PromptLayer skill collections available in the API-key workspace.

List Table Columns

List one page of user and optionally system columns for a PromptLayer Table sheet.

List Table Rows

Read one page of rows and cells from a PromptLayer Table sheet, with optional schema and execution aggregates.

List Tables

Search and page through PromptLayer Tables by folder, name, or referenced prompt.

List Table Scorecard Rows

List one page of row-level scorecard summaries for a PromptLayer table sheet.

List Table Sheet Operations

List active recalculation operations and cell status counts for a PromptLayer Table sheet in the API key's workspace.

List Table Sheets

List one page of sheets in a PromptLayer Table, optionally filtering by referenced prompt.

List Table Sheet Versions

List one page of saved versions for a PromptLayer Table sheet in the API key's workspace.

List Workflow External IDs

List all external system identifiers attached to a PromptLayer workflow by its numeric ID.

List Workflow Labels

List all release labels for a PromptLayer workflow by ID or name, including the version ID and version number each label points to.

List Workflows

Search and page through PromptLayer workflows without running them.

List Workspace Env Vars

List environment variables for the API key's PromptLayer workspace.

Log Request

Log an existing model request and response in PromptLayer with timing, usage, cost, tags, metadata, and optional prompt association.

Migrate Table Sheet Legacy Score

Convert a PromptLayer Table sheet's existing legacy score configuration into scorecard criteria.

Move Folder Entities

Move PromptLayer registry entities into a destination folder or to the workspace root.

Move Prompt Template Label

Move an existing PromptLayer release label to a different version of the same prompt template.

Patch Prompt Template Version

Create a new version of an existing PromptLayer template by patching its latest version, a specific version, or a release label.

Patch Workflow

Partially update a PromptLayer workflow by ID or name, creating a new version from the latest or a specified base version.

Publish Prompt Template

Publish a PromptLayer registry prompt template and a new version of its chat or completion content.

Query Request Analytics

Read custom aggregate analytics over PromptLayer request logs.

Query Trace Analytics

Read custom aggregate analytics over PromptLayer traces and spans with recursive filters.

Recalculate Table Cell

Trigger recalculation for one PromptLayer Table cell.

Recalculate Table Cells

Trigger recalculation for a batch of PromptLayer Table cells by ID.

Recalculate Table Sheet Score

Queue recalculation of an existing PromptLayer Table sheet score configuration.

Recalculate Table Sheet Scorecard

Queue recalculation of an existing PromptLayer table sheet scorecard, optionally limited to row indices and step UUIDs.

Render Prompt Template

Retrieve a prompt template by name or ID and render provider-ready llm_kwargs with input_variables using POST.

Resolve Folder ID

Resolve a PromptLayer folder's ID from its dot-separated folder path within a specified workspace.

Run Workflow

Start an execution of a PromptLayer workflow by name, using its latest version or one specified label or version number.

Save Skill Collection Version

Create a new saved version of a PromptLayer skill collection by UUID, name, or root path.

Search Request Logs

Search PromptLayer request logs by text or structured filters and return one rate-limited page sorted by operational fields.

Test Execute Registered Tool

Execute a PromptLayer registered tool's code in its sandbox by ID or name, optionally selecting a version or label and testing unsaved code or a tool definition.

Track Group

Associate an existing PromptLayer request log with an existing group using their integer IDs.

Track Metadata

Associate custom metadata with an existing PromptLayer request log using its request ID.

Track Prompt

Associate an existing PromptLayer request log with a named prompt template, optionally specifying its version or release label and the variables used to render it.

Track Score

Record a score from 0 to 100 on an existing PromptLayer request log.

Update Folder

Rename an existing PromptLayer folder by ID.

Update Registered Tool Environment Variable

Replace the stored value of an existing PromptLayer registered tool environment variable by tool ID or name and variable ID.

Update Skill Collection

Rename a PromptLayer skill collection identified by UUID, name, or root path.

Update Table

Update a PromptLayer Table's title or folder by UUID.

Update Table Cell

Edit the display value or structured value of a PromptLayer table cell.

Update Table Column

Update a PromptLayer Table sheet column's title, configuration, or dependencies.

Update Table Sheet

Update a PromptLayer Table sheet's title or zero-based display position.

Update Workspace Environment Variable

Replace the stored value of an existing PromptLayer workspace environment variable by ID.

Upsert Prompt Template by External ID

Create or update a PromptLayer registry prompt template identified by an external source and ID.

SETUP GUIDE

Connect PromptLayer MCP Tool with your Agent

1

Install Composio

typescript
npm install @composio/core ai @ai-sdk/mcp @ai-sdk/openai
Install the Composio SDK and your agent framework
2

Create a session with MCP enabled

typescript
import { Composio } from "@composio/core";

const composio = new Composio();
const { mcp } = await composio.create("your-user-id", {
  toolkits: ["promptlayer"],
  mcp: true,
});
Create a session scoped to PromptLayer and read its MCP URL and headers
3

Connect your agent to the MCP server

typescript
import { createMCPClient } from "@ai-sdk/mcp";
import { openai } from "@ai-sdk/openai";
import { generateText, stepCountIs } from "ai";

const client = await createMCPClient({
  transport: { type: "http", url: mcp.url, headers: mcp.headers },
});

const { text } = await generateText({
  model: openai("gpt-5.6-sol"),
  tools: await client.tools(),
  prompt: "List failed PromptLayer requests from the last 24 hours and summarize the main error patterns",
  stopWhen: stepCountIs(10),
});

console.log(text);
await client.close();
Pass the session's MCP URL and headers to your agent and run a PromptLayer request
SETUP GUIDE

Connect PromptLayer API Tool with your Agent

1

Install Composio

typescript
npm install @composio/core @composio/openai openai
Install the Composio SDK, the OpenAI provider, and the OpenAI SDK
2

Create a Composio session

typescript
import OpenAI from "openai";
import { Composio } from "@composio/core";
import { OpenAIResponsesProvider } from "@composio/openai";

const composio = new Composio({ provider: new OpenAIResponsesProvider() });
const client = new OpenAI();

const session = await composio.create("your-user-id", { toolkits: ["promptlayer"] });
const tools = await session.tools();
Initialize Composio with the OpenAI Responses provider and create a session scoped to PromptLayer
3

Run PromptLayer tools with your agent

typescript
let response = await client.responses.create({
  model: "gpt-5.6-sol",
  tools,
  input: [{ role: "user", content: "List failed PromptLayer requests from the last 24 hours and summarize the main error patterns" }],
});

while (response.output.some((o) => o.type === "function_call")) {
  const outputs = await composio.provider.handleToolCalls(session, response.output);
  response = await client.responses.create({
    model: "gpt-5.6-sol",
    tools,
    previous_response_id: response.id,
    input: outputs,
  });
}

console.log(response.output_text);
Send a request, execute the PromptLayer tool calls through the session, and print the final answer

Why Use Composio?

AI Native PromptLayer Integration

  • Supports both PromptLayer MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable prompt, log, and evaluation workflows
  • Rich coverage for reading, writing, and querying your PromptLayer data without bespoke integration code

Managed Auth

  • PromptLayer uses API key auth, and Composio keeps those keys out of your agent code
  • Create auth configs with auth_configs.create() and link user accounts with connected_accounts.link()
  • Use per user and per environment credentials instead of hard-coded PromptLayer keys

Agent Optimized Design

  • Tools are tuned for LLMs, so agents can safely inspect PromptLayer runs, evaluations, and prompt versions
  • Comprehensive execution logs help you see what ran, when, and on whose behalf
  • Use mcp.create() or Tool Router sessions to connect PromptLayer to Claude, ChatGPT, Cursor, and other agents

Enterprise Grade Security

  • Fine-grained RBAC helps you control which agents and users can access PromptLayer
  • Scoped, least privilege access keeps PromptLayer prompt and observability data protected
  • Full audit trails make agent activity easier to review, debug, and govern
FRAMEWORKS

Use PromptLayer with any AI Agent Framework

Choose a Framework you want to connect PromptLayer with

Rolling this out across your team?

Give your team centralized access control across every framework with Composio’s MCP Gateway.

EXPLORE MCP GATEWAY
FAQ

Frequently asked questions

Start with PromptLayer.It takes 30 seconds.

Managed auth, hosted MCP servers, and every PromptLayer tool your agent needs.Free to start.

Start building