Skip to main content
Glama

get_delegate

Retrieve a specific delegate's information from Gmail to manage email access permissions and delegation settings.

Instructions

Gets the specified delegate

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
delegateEmailYesThe email address of the delegate to retrieve

Implementation Reference

  • The handler function for the 'get_delegate' tool, which retrieves the specified delegate's information using the Gmail API via handleTool wrapper.
    server.tool("get_delegate",
      "Gets the specified delegate",
      {
        delegateEmail: z.string().describe("The email address of the delegate to retrieve")
      },
      async (params) => {
        return handleTool(config, async (gmail: gmail_v1.Gmail) => {
          const { data } = await gmail.users.settings.delegates.get({ userId: 'me', delegateEmail: params.delegateEmail })
          return formatResponse(data)
        })
      }
    )
  • Input schema for the 'get_delegate' tool using Zod, requiring delegateEmail.
    {
      delegateEmail: z.string().describe("The email address of the delegate to retrieve")
    },
  • src/index.ts:974-985 (registration)
    Registration of the 'get_delegate' MCP tool on the McpServer instance.
    server.tool("get_delegate",
      "Gets the specified delegate",
      {
        delegateEmail: z.string().describe("The email address of the delegate to retrieve")
      },
      async (params) => {
        return handleTool(config, async (gmail: gmail_v1.Gmail) => {
          const { data } = await gmail.users.settings.delegates.get({ userId: 'me', delegateEmail: params.delegateEmail })
          return formatResponse(data)
        })
      }
    )
  • Shared helper function used by all tools, including get_delegate, to handle OAuth2 authentication and Gmail API calls.
    const handleTool = async (queryConfig: Record<string, any> | undefined, apiCall: (gmail: gmail_v1.Gmail) => Promise<any>) => {
      try {
        const oauth2Client = queryConfig ? createOAuth2Client(queryConfig) : defaultOAuth2Client
        if (!oauth2Client) throw new Error('OAuth2 client could not be created, please check your credentials')
    
        const credentialsAreValid = await validateCredentials(oauth2Client)
        if (!credentialsAreValid) throw new Error('OAuth2 credentials are invalid, please re-authenticate')
    
        const gmailClient = queryConfig ? google.gmail({ version: 'v1', auth: oauth2Client }) : defaultGmailClient
        if (!gmailClient) throw new Error('Gmail client could not be created, please check your credentials')
    
        const result = await apiCall(gmailClient)
        return result
      } catch (error: any) {
        return `Tool execution failed: ${error.message}`
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It only states the action without disclosing behavioral traits like read-only nature, error handling, authentication needs, or rate limits. For a retrieval tool, this lack of detail leaves the agent uncertain about safety and performance implications.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with a single sentence that directly states the tool's function. It's front-loaded and wastes no words, making it easy to parse quickly, though this brevity contributes to gaps in other dimensions.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what a delegate is, what data is returned, or any behavioral context, making it inadequate for an agent to fully understand how to use this tool effectively in a real-world scenario.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, clearly documenting the single parameter 'delegateEmail'. The description doesn't add extra meaning beyond the schema, but with high coverage and only one parameter, a baseline of 4 is appropriate as the schema adequately handles the semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the action ('Gets') and resource ('the specified delegate'), which clarifies the basic purpose. However, it's vague about what a 'delegate' is in this context and doesn't differentiate from sibling tools like 'list_delegates' or 'remove_delegate', leaving room for confusion about scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites, such as needing an existing delegate, or contrast it with 'list_delegates' for browsing all delegates, which could lead to misuse in scenarios where listing is more appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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