Skip to main content
Glama

Superglue MCP

Official
by superglue-ai
workflows.ts1.84 kB
import { FastifyReply } from 'fastify'; import { logMessage } from '../utils/logs.js'; import { registerApiModule } from './registry.js'; import { AuthenticatedFastifyRequest } from './types.js'; interface WorkflowRequest extends AuthenticatedFastifyRequest { params: { id: string }; body: any; } const getWorkflows = async (request: WorkflowRequest, reply: FastifyReply) => { try { const { datastore, orgId } = request; const workflows = await datastore.listWorkflows({ orgId }); logMessage('info', `Listed ${workflows.length} workflows`, { orgId }); return { success: true, data: workflows, count: workflows.length }; } catch (error) { logMessage('error', `Failed to list workflows: ${error}`, { orgId: request.orgId }); reply.code(500); return { success: false, error: 'Failed to list workflows' }; } }; const getWorkflow = async (request: WorkflowRequest, reply: FastifyReply) => { try { const { datastore, orgId, params } = request; const workflow = await datastore.getWorkflow({ id: params.id, orgId }); if (!workflow) { reply.code(404); return { success: false, error: 'Workflow not found' }; } logMessage('info', `Retrieved workflow ${params.id}`, { orgId }); return { success: true, data: workflow }; } catch (error) { logMessage('error', `Failed to get workflow ${request.params.id}: ${error}`, { orgId: request.orgId }); reply.code(500); return { success: false, error: 'Failed to get workflow' }; } }; // Register the workflow routes registerApiModule({ name: 'workflows', routes: [ { method: 'GET', path: '/workflows', handler: getWorkflows }, { method: 'GET', path: '/workflows/:id', handler: getWorkflow }, ] });

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/superglue-ai/superglue'

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