import type { IMastraLogger } from '@mastra/core/logger'; import type { GetPromptResult, Prompt } from '@modelcontextprotocol/sdk/types.js'; import type { InternalMastraMCPClient } from '../client.js'; interface PromptClientActionsConfig { client: InternalMastraMCPClient; logger: IMastraLogger; } /** * Client-side prompt actions for interacting with MCP server prompts. * * Provides methods to list, retrieve, and subscribe to prompt templates exposed by an MCP server. * Prompts are reusable message templates that can be parameterized and used for AI interactions. */ export declare class PromptClientActions { private readonly client; private readonly logger; /** * @internal */ constructor({ client, logger }: PromptClientActionsConfig); /** * Retrieves all available prompts from the connected MCP server. * * Returns an empty array if the server doesn't support prompts (MethodNotFound error). * * @returns Promise resolving to array of prompts with their metadata * @throws {Error} If fetching prompts fails (excluding MethodNotFound) * * @example * ```typescript * const prompts = await client.prompts.list(); * prompts.forEach(prompt => { * console.log(`${prompt.name}: ${prompt.description}`); * }); * ``` */ list(): Promise; /** * Retrieves a specific prompt with its messages from the MCP server. * * Prompts can accept arguments to parameterize the template. The returned messages * can be used directly in AI chat completions. * * @param params - Parameters for the prompt request * @param params.name - Name of the prompt to retrieve * @param params.args - Optional arguments to populate the prompt template * @returns Promise resolving to the prompt result with messages * @throws {Error} If fetching the prompt fails or prompt not found * * @example * ```typescript * const prompt = await client.prompts.get({ * name: 'code-review', * args: { * language: 'typescript', * code: 'const x = 1;' * }, * }); * * // Use prompt messages in AI completion * console.log(prompt.messages); * ``` */ get({ name, args }: { name: string; args?: Record; }): Promise; /** * Sets a notification handler for when the list of available prompts changes. * * The handler is called when prompts are added, removed, or modified on the server. * * @param handler - Callback function invoked when the prompt list changes * * @example * ```typescript * await client.prompts.onListChanged(async () => { * console.log('Prompt list changed, re-fetching...'); * const prompts = await client.prompts.list(); * console.log('Available prompts:', prompts.map(p => p.name)); * }); * ``` */ onListChanged(handler: () => void): Promise; } export {}; //# sourceMappingURL=prompt.d.ts.map