Skip to main content
Glama
projects.ts1.95 kB
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; import { SuperProductivityClient } from "../client/sp-client.js"; export function setupProjectTools(server: McpServer, client: SuperProductivityClient) { // Tool: List Projects server.tool( "list_projects", {}, async () => { try { const projects = await client.getProjects(); return { content: [ { type: "text", text: JSON.stringify( { count: projects.length, projects: projects, }, null, 2 ), }, ], }; } catch (error: any) { return { content: [ { type: "text", text: `Error: ${error.message}`, }, ], isError: true, }; } } ); // Tool: Create Project server.tool( "create_project", { title: z.string().describe("Project title"), theme: z.record(z.any()).optional().describe("Project theme configuration"), isArchived: z.boolean().optional().default(false), }, async (params) => { try { const projectId = await client.createProject(params); return { content: [ { type: "text", text: JSON.stringify({ success: true, projectId, message: `Project created: ${params.title}`, }), }, ], }; } catch (error: any) { return { content: [ { type: "text", text: `Error: ${error.message}`, }, ], isError: true, }; } } ); }

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/rochadelon/super-productivity-mcp'

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