Skip to main content
Glama

Thingiverse MCP Server

by gpaul-mcp
getThingsFromCategory.ts1.4 kB
import ThingiversePuppeteer from '@/class/thingiverser.class'; import { mcpServer } from '@/index'; import z from 'zod'; mcpServer.tool( 'get-random-thing-from-category', 'Get random items from the given category', { categorySlug: z.string().describe('category slug to search in'), }, async ({ categorySlug }) => { const thingiverser = new ThingiversePuppeteer(process.env.APP_TOKEN as string); await thingiverser.init(); try { const things = await thingiverser.getRandomThingsFromCategory(categorySlug); if (things.length === 0) { await thingiverser.close(); return { isError: true, content: [{ type: 'text', text: 'No things found' }], }; } await thingiverser.close(); const returnThings = []; for (const thing of things) { returnThings.push({ name: thing.name, url: thing.public_url, likeCount: thing.like_count, descrtipion: thing.description, filesUrl: thing.files_url, tags: thing.tags, }); } return { content: [{ type: 'text', text: JSON.stringify(returnThings, null, 2) }], }; } catch (error) { await thingiverser.close(); return { isError: true, content: [{ type: 'text', text: `Error fetching random things: ${error}` }], }; } }, );

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_thingiverse'

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