Skip to main content
Glama

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
NameRequiredDescriptionDefault
idYesThe ID of the label to retrieve

Implementation Reference

  • 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) }) }
  • 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) }) } )

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/faithk7/gmail-mcp'

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