get_label
Retrieve a specific Gmail label by its unique ID to access label details for email organization and management.
Instructions
Get a specific label by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The ID of the label to retrieve |
Implementation Reference
- src/index.ts:473-478 (handler)The handler function for the 'get_label' tool. It uses handleTool to manage authentication and then calls the Gmail API to retrieve the specific label by its ID.async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.labels.get({ userId: 'me', id: params.id }) return formatResponse(data) }) }
- src/index.ts:470-472 (schema)The input schema for the 'get_label' tool, defining the required 'id' parameter as a string.{ id: z.string().describe("The ID of the label to retrieve") },
- src/index.ts:468-479 (registration)The registration of the 'get_label' tool on the MCP server using server.tool(), including description, schema, and handler.server.tool("get_label", "Get a specific label by ID", { id: z.string().describe("The ID of the label to retrieve") }, async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.labels.get({ userId: 'me', id: params.id }) return formatResponse(data) }) } )