Skip to main content
Glama

Practera MCP Server

by intersective
get-project.ts2.35 kB
import { z } from 'zod'; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { createGraphQLClient } from '../libs/graphql-client.js'; // Define types for tool results export type ToolResult = { content: Array<{ type: "text"; text: string; }>; isError?: boolean; }; /** * Register project query tool with MCP server */ export function registerGetProjectTool(server: McpServer) { server.tool( 'mcp_practera_get_project', 'Get details about a Practera project', { apikey: z.string().optional().describe('API key for Practera authentication'), region: z.string().optional().describe('Practera region (usa, aus, euk, or stage)'), }, async (params: { apikey?: string, region?: string }): Promise<ToolResult> => { try { const region = params.region || 'usa'; // Create auth config const authConfig = { apikey: params.apikey || '' }; const client = createGraphQLClient(authConfig, region); const query = ` query project { project { id name milestones { id name description isLocked activities { id name description instructions isLocked leadImage tasks { id name type isLocked isTeam deadline contextId assessmentType } } } } } `; const variables = { }; const data = await client.request(query, variables); return { content: [ { type: "text", text: JSON.stringify(data, null, 2) } ] } as ToolResult; } catch (error) { return { content: [ { type: "text", text: `Error fetching project: ${error instanceof Error ? error.message : String(error)}` } ], isError: true } as ToolResult; } } ); }

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/intersective/practera-mcp-server'

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