Skip to main content
Glama
getMultiplePatternDetails.tsโ€ข972 B
import Ravelry from '@/class/ravelry.class'; import { mcpServer } from '@/index'; import { number, z } from 'zod'; mcpServer.tool( 'get-multiple-pattern-details', 'Retrieve details for a list of patterns on Ravelry', { ids: z.array(number()).describe('Ids of the patterns to be retrieved'), }, async ({ ids }) => { const ravelryInstance = new Ravelry( process.env.AUTH_USER as string, process.env.AUTH_PASS as string, ); try { const patterns = await ravelryInstance.getMultiplePatternDetails(ids); if (!patterns) { return { isError: true, content: [{ type: 'text', text: 'No pattern found' }], }; } return { content: [{ type: 'text', text: JSON.stringify(patterns, null, 2) }], }; } catch (error) { return { isError: true, content: [{ type: 'text', text: 'Failure while fetching details for a patterns' }], }; } }, );

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/gpaul-mcp/MCP_ravelry'

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