PromptLayer MCP for AI Agents

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.

16 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.

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 Log

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

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 Workflow

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

List Folder Entities

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

List Prompt Templates

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

List Registered Tools

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

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 Sheets

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

List Workflows

Search and page through PromptLayer workflows without running them.

Search Request Logs

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

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
FAQ

Frequently asked questions

Yes, PromptLayer requires you to configure your own API key credentials. Once set up, Composio handles secure credential storage and API request handling for you.

Yes! Composio's Tool Router enables agents to use multiple toolkits. Learn more.

Composio is SOC 2 and ISO 27001 compliant with all data encrypted in transit and at rest. Learn more.

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

Start with PromptLayer.It takes 30 seconds.

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

Start building