Skip to main content
Glama
mlobo2012

Claude Desktop API MCP

by mlobo2012

send-message

Send a message to Claude via the Claude Desktop API MCP to access advanced features and bypass Professional Plan limitations, enabling direct interaction and conversation management.

Instructions

Send a message to Claude

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesMessage to send to Claude

Implementation Reference

  • The handler logic for the "send-message" tool. It validates the tool name and message argument, calls the Anthropic Claude API to create a message with the user input, extracts the text response, and returns it in the expected format. Errors are logged and rethrown.
    if (request.params.name === "send-message" && request.params.arguments?.message) { try { const msg = await client.messages.create({ model: "claude-3-opus-20240229", max_tokens: 1024, messages: [ { role: "user", content: String(request.params.arguments.message) } ] }); const responseText = msg.content[0].type === 'text' ? msg.content[0].text : 'No text response available'; return { content: [ { type: "text", text: responseText } ] }; } catch (error) { log(`Error calling Claude API: ${error}`); throw error; } }
  • Input schema definition for the "send-message" tool, specifying an object with a required 'message' property of type string.
    inputSchema: { type: "object", properties: { message: { type: "string", description: "Message to send to Claude" } }, required: ["message"] }
  • src/index.ts:30-44 (registration)
    Registration of the "send-message" tool in the ListTools response, including name, description, and input schema.
    { name: "send-message", description: "Send a message to Claude", inputSchema: { type: "object", properties: { message: { type: "string", description: "Message to send to Claude" } }, required: ["message"] } } ]

Other Tools

Related Tools

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/mlobo2012/Claude_Desktop_API_USE_VIA_MCP'

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