Skip to main content
Glama
epicweb-dev

Advanced MCP Features

by epicweb-dev
sampling.ts1.09 kB
import { type EpicMeMCP } from './index.ts' export async function suggestTagsSampling(agent: EpicMeMCP, entryId: number) { // 🐨 get the client capabilities // 🐨 if the client does not support sampling, console.error a message and return // // 🐨 create a message with the server's server // 💰 agent.server.server.createMessage // 🐨 Make the system prompt something simple to start like "you're a helpful assistant" // 🐨 Add a user message with the content "You just created a new journal entry with the id ${entryId}. Please respond with a proper commendation for yourself." // 🐨 Set the maxTokens what you think is reasonable for the request // // 🐨 logging message to send the model response to the client // 📜 https://modelcontextprotocol.io/specification/2025-06-18/server/utilities/logging#log-message-notifications // 💰 agent.server.server.sendLoggingMessage (with level of 'info', logger of 'tag-generator', and data with the model response) // 🦉 The SDK will make sure to only send messages if the logging level is 'debug' or 'info' }

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