Skip to main content
Glama
execute_workflow.js1.29 kB
const executeWorkflow = { key: 'execute_workflow', noun: 'Workflow', display: { label: 'Execute Workflow', description: 'Execute an MCP workflow' }, operation: { inputFields: [ { key: 'workflow', required: true, type: 'text', helpText: 'JSON array of workflow steps' }, { key: 'context', required: false, type: 'text', helpText: 'Optional context string' } ], perform: async (z, bundle) => { let workflowArray; try { workflowArray = JSON.parse(bundle.inputData.workflow); } catch (e) { throw new z.errors.Error('Workflow must be valid JSON array'); } const body = { workflow: workflowArray, context: bundle.inputData.context, // apiKey intentionally not in body; rely on server verifying user-level restrictions }; const response = await z.request({ url: `${bundle.authData.baseUrl}/api/workflow`, method: 'POST', body: JSON.stringify(body), headers: { 'Content-Type': 'application/json' } }); return response.json; }, sample: { results: [ { output: 'First result', provider: 'openai', command: 'summarize' } ] } } }; module.exports = executeWorkflow;

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/sentilabs01/mcpserver'

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