teams-get-by-id
Retrieve a specific team's details from Shortcut project management using its public ID. Specify whether to return full team data or a slim version with essential fields.
Instructions
Get a Shortcut team by public ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| teamPublicId | Yes | The public ID of the team to get | |
| full | No | True to return all team fields from the API. False to return a slim version that excludes uncommon fields |
Implementation Reference
- src/tools/teams.ts:10-24 (registration)Registers the 'teams-get-by-id' tool, including input schema with Zod validation and an inline async handler that delegates to the getTeam method.server.addToolWithReadAccess( "teams-get-by-id", "Get a Shortcut team by public ID", { teamPublicId: z.string().describe("The public ID of the team to get"), full: z .boolean() .optional() .default(false) .describe( "True to return all team fields from the API. False to return a slim version that excludes uncommon fields", ), }, async ({ teamPublicId, full }) => await tools.getTeam(teamPublicId, full), );
- src/tools/teams.ts:13-22 (schema)Zod schema defining input parameters: teamPublicId (required string) and full (optional boolean, default false).{ teamPublicId: z.string().describe("The public ID of the team to get"), full: z .boolean() .optional() .default(false) .describe( "True to return all team fields from the API. False to return a slim version that excludes uncommon fields", ), },
- src/tools/teams.ts:35-44 (handler)Core handler function: fetches the team using ShortcutClientWrapper's getTeam method, handles not found case, and formats the result with entity details using base class helpers.async getTeam(teamPublicId: string, full = false) { const team = await this.client.getTeam(teamPublicId); if (!team) return this.toResult(`Team with public ID: ${teamPublicId} not found.`); return this.toResult( `Team: ${team.id}`, await this.entityWithRelatedEntities(team, "team", full), ); }