Skip to main content
Glama

get-default-workflow

Retrieve the default workflow for a specific team or the global default when no team is specified, streamlining project setup and management within the Shortcut MCP Server environment.

Instructions

Get the default workflow for a specific team or the global default if no team is specified.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
teamPublicIdNoThe public ID of the team to get the default workflow for.

Implementation Reference

  • The core handler function implementing the logic to retrieve the default Shortcut workflow for a specific team or the global workspace default. It fetches team-specific default if provided, falls back to workspace default, formats results using inherited methods.
    async getDefaultWorkflow(teamPublicId?: string) { if (teamPublicId) { try { const teamDefaultWorkflowId = await this.client .getTeam(teamPublicId) .then((t) => t?.default_workflow_id); if (teamDefaultWorkflowId) { const teamDefaultWorkflow = await this.client.getWorkflow(teamDefaultWorkflowId); if (teamDefaultWorkflow) { return this.toResult( `Default workflow for team "${teamPublicId}" has id ${teamDefaultWorkflow.id}.`, await this.entityWithRelatedEntities(teamDefaultWorkflow, "workflow"), ); } } } catch {} } const currentUser = await this.client.getCurrentUser(); if (!currentUser) throw new Error("Failed to retrieve current user."); const workspaceDefaultWorkflowId = currentUser.workspace2.default_workflow_id; const workspaceDefaultWorkflow = await this.client.getWorkflow(workspaceDefaultWorkflowId); if (workspaceDefaultWorkflow) { return this.toResult( `${teamPublicId ? `No default workflow found for team with public ID "${teamPublicId}". The general default workflow has id ` : "Default workflow has id "}${workspaceDefaultWorkflow.id}.`, await this.entityWithRelatedEntities(workspaceDefaultWorkflow, "workflow"), ); } return this.toResult("No default workflow found."); }
  • Registers the MCP tool named 'workflows-get-default' (matches intent of 'get-default-workflow') with input schema and delegates to the getDefaultWorkflow handler.
    server.addToolWithReadAccess( "workflows-get-default", "Get the default workflow for a specific team or the global default if no team is specified.", { teamPublicId: z .string() .optional() .describe("The public ID of the team to get the default workflow for."), }, async ({ teamPublicId }) => await tools.getDefaultWorkflow(teamPublicId), );
  • Zod input schema for the tool: optional teamPublicId string.
    { teamPublicId: z .string() .optional() .describe("The public ID of the team to get the default workflow for."), },

Latest Blog Posts

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/useshortcut/mcp-server-shortcut'

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