workflows-get-default
Retrieve the default workflow for a specified team or the global default workflow when no team is provided.
Instructions
Get the default workflow for a specific team or the global default if no team is specified.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| teamPublicId | No | The public ID of the team to get the default workflow for. |
Implementation Reference
- src/tools/workflows.ts:47-79 (handler)The main handler function that retrieves the default workflow for a team or the global default, using the ShortcutClientWrapper.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."); }
- src/tools/workflows.ts:10-20 (registration)Registers the 'workflows-get-default' tool with the MCP server, including schema and handler reference.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), );
- src/tools/workflows.ts:13-18 (schema)Zod schema for the tool input parameters.{ teamPublicId: z .string() .optional() .describe("The public ID of the team to get the default workflow for."), },