Skip to main content
Glama

Spotify Streamable MCP Server

by iceener
add.tool.ts1.02 kB
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'; import { toolsMetadata } from '../config/metadata.ts'; import { AddInputSchema } from '../schemas/inputs.ts'; type AddArgs = { a: number; b: number }; export const addTool = { name: toolsMetadata.add.name, title: toolsMetadata.add.title, description: toolsMetadata.add.description, inputSchema: AddInputSchema.shape, handler: async (args: AddArgs): Promise<CallToolResult> => { const parsed = AddInputSchema.safeParse(args); if (!parsed.success) { return { isError: true, content: [ { type: 'text', text: 'Invalid arguments: a and b must be numbers', }, ], }; } const { a: firstValue, b: secondValue } = parsed.data; const sum = firstValue + secondValue; return { content: [ { type: 'text', text: `The result is ${String(sum)}`, }, ], structuredContent: { sum }, }; }, };

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/iceener/spotify-streamable-mcp-server'

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