my_workflows
Retrieve a list of your published AI workflows (glifs) with run counts and creation dates to review and manage your custom agents.
Instructions
Get a list of your published workflows (glifs). Shows your AI workflows with run counts and creation dates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/my-glifs.ts:22-41 (handler)The handler function for the 'my_workflows' tool. Calls getMyGlifs() API and formats the results into a text response listing workflows with their IDs, descriptions, creation dates, and run counts.
export async function handler(): Promise<ToolResponse> { const glifs = await getMyGlifs(); const formattedGlifs = glifs .map( (glif) => `${glif.name} (${glif.id})\n${glif.description}\nCreated: ${new Date( glif.createdAt ).toLocaleString()}\nRuns: ${glif.completedSpellRunCount}\n` ) .join("\n"); return { content: [ { type: "text", text: `Your workflows:\n\n${formattedGlifs}`, }, ], }; } - src/tools/my-glifs.ts:5-5 (schema)The Zod schema for the tool. Empty object (no input parameters required).
export const schema = z.object({}); - src/tools/registry.ts:18-35 (registration)Registration of the 'my_workflows' tool in the TOOL_REGISTRY under the 'discovery' group, gated by env.discovery.enabled().
export const TOOL_REGISTRY: ToolGroupConfig[] = [ { name: "core", enabled: () => true, tools: { [glifInfo.definition.name]: glifInfo, [runGlif.definition.name]: runGlif, }, }, { name: "discovery", enabled: () => env.discovery.enabled(), tools: { [listFeaturedGlifs.definition.name]: listFeaturedGlifs, [searchGlifs.definition.name]: searchGlifs, [myGlifs.definition.name]: myGlifs, [myGlifUserInfo.definition.name]: myGlifUserInfo, }, - src/tools/index.ts:78-125 (registration)Tool handler setup in the MCP server. Routes tool call requests to the correct handler from the registry.
export function setupToolHandlers(server: Server) { logger.debug("Setting up tool handlers"); server.setRequestHandler(ListToolsRequestSchema, async () => getTools()); server.setRequestHandler(CallToolRequestSchema, async (request) => { logger.debug("Tool call received", { name: request.params.name, args: request.params.arguments, }); // Check if this is a GLIF_IDS tool const glifIdMatch = request.params.name.match(/^glif_(.+)$/); const glifId = glifIdMatch?.[1]; if ( glifIdMatch && glifId && GLIF_IDS.includes(glifId) && request.params.arguments ) { const args = z .object({ inputs: z.array(z.string()) }) .parse(request.params.arguments); return runGlif.handler({ ...request, params: { ...request.params, arguments: { id: glifId, inputs: args.inputs, }, }, }); } // Handle all registered tools const enabledTools = getEnabledTools(); const tool = enabledTools[request.params.name]; if (tool) { return tool.handler(request); } throw new McpError( ErrorCode.MethodNotFound, `Unknown tool: ${request.params.name}` ); }); } - src/api.ts:195-204 (helper)The getMyGlifs() helper function that makes the API call to fetch the user's published glifs/workflows.
export async function getMyGlifs(): Promise<Glif[]> { const userId = cachedUserId ?? (await getMyUserInfo()).id; logger.debug("getMyGlifs", { userId }); return apiRequest<Glif[]>("/glifs", "get", { queryParams: { userId }, schema: z.array(GlifSchema), context: "getMyGlifs", }); }