We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Arize-ai/phoenix'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
listPrompts.ts•809 B
import invariant from "tiny-invariant";
import { createClient } from "../client";
import type { ClientFn } from "../types/core";
import type { Prompt } from "../types/prompts";
export type ListPromptsParams = ClientFn;
/**
* List all prompts available to the client.
*
* @example
* ```ts
* import { listPrompts } from "@arizeai/phoenix-client/prompts";
*
* const prompts = await listPrompts({});
* console.log(prompts);
* ```
*
* @throws {Error} If the prompts cannot be listed or the response is invalid.
*/
export async function listPrompts({
client: _client,
}: ListPromptsParams): Promise<Prompt[]> {
const client = _client || createClient();
const response = await client.GET("/v1/prompts");
invariant(response.data?.data, "Failed to list prompts");
return response.data.data;
}