Skip to main content
Glama
epicweb-dev

Advanced MCP Features

by epicweb-dev
sampling.ts987 B
import { type EpicMeMCP } from './index.ts' export async function suggestTagsSampling(agent: EpicMeMCP, entryId: number) { const clientCapabilities = agent.server.server.getClientCapabilities() if (!clientCapabilities?.sampling) { console.error('Client does not support sampling, skipping sampling request') return } const result = await agent.server.server.createMessage({ systemPrompt: ` You are a helpful assistant. We'll put more in here later... `.trim(), messages: [ { role: 'user', content: { type: 'text', text: ` You just created a new journal entry with the id ${entryId}. Please respond with a proper commendation for yourself. `.trim(), }, }, ], maxTokens: 10, }) void agent.server.server.sendLoggingMessage({ level: 'info', logger: 'tag-generator', data: { message: 'Received response from model', // @ts-ignore 🤷‍♂️ pretty sure this is correct modelResponse: result.content.text, }, }) }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/epicweb-dev/advanced-mcp-features'

If you have feedback or need assistance with the MCP directory API, please join our Discord server