Skip to main content
Glama

Glif

Official
by glifxyz
import { z } from "zod"; import { CallToolRequestSchema } from "@modelcontextprotocol/sdk/types.js"; import { runGlif } from "../api.js"; import { formatOutput } from "../utils.js"; import type { ToolResponse } from "./index.js"; type CallToolRequest = z.infer<typeof CallToolRequestSchema>; export const schema = z.object({ id: z.string(), inputs: z.array(z.string()), }); export const definition = { name: "run_glif", description: "Run a glif with the specified ID and inputs", inputSchema: { type: "object", properties: { id: { type: "string", description: "The ID of the glif to run", }, inputs: { type: "array", items: { type: "string", }, description: "Array of input values for the glif", }, }, required: ["id", "inputs"], }, }; export async function handler(request: CallToolRequest): Promise<ToolResponse> { const args = schema.parse(request.params.arguments); const result = await runGlif(args.id, args.inputs); // Handle case where outputFull might be undefined or output might be null if (!result.outputFull || result.output === null) { return { content: [ { type: "text", text: "No output received from glif run", }, ], }; } return { content: [ { type: "text", text: formatOutput(result.outputFull.type, result.output), }, ], }; }

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/glifxyz/glif-mcp-server'

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