Skip to main content
Glama

get_pop

Retrieve POP3 configuration settings for Gmail accounts to enable email client setup and access.

Instructions

Gets POP settings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:864-873 (registration)
    Registration of the 'get_pop' MCP tool. It has no input parameters (empty schema) and an inline handler function that uses the shared 'handleTool' to authenticate and call the Gmail API's users.settings.getPop method to retrieve POP settings, then formats the response.
    server.tool("get_pop",
      "Gets POP settings",
      {},
      async () => {
        return handleTool(config, async (gmail: gmail_v1.Gmail) => {
          const { data } = await gmail.users.settings.getPop({ userId: 'me' })
          return formatResponse(data)
        })
      }
    )
  • Handler function for 'get_pop' tool, which invokes the Gmail API to get POP settings after authentication via handleTool.
    async () => {
      return handleTool(config, async (gmail: gmail_v1.Gmail) => {
        const { data } = await gmail.users.settings.getPop({ userId: 'me' })
        return formatResponse(data)
      })
    }
  • Shared helper function 'handleTool' used by 'get_pop' (and other tools) to handle OAuth2 authentication, create Gmail client, execute the API call, and handle errors appropriately.
    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) {
        // Check for specific authentication errors
        if (
          error.message?.includes("invalid_grant") ||
          error.message?.includes("refresh_token") ||
          error.message?.includes("invalid_client") ||
          error.message?.includes("unauthorized_client") ||
          error.code === 401 ||
          error.code === 403
        ) {
          return formatResponse({
            error: `Authentication failed: ${error.message}. Please re-authenticate by running: npx @shinzolabs/gmail-mcp auth`,
          });
        }
    
        return formatResponse({ error: `Tool execution failed: ${error.message}` });
      }
    }
  • Helper function 'formatResponse' used by 'get_pop' (and other tools) to format the API response as MCP content.
    const formatResponse = (response: any) => ({ content: [{ type: "text", text: JSON.stringify(response) }] })
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Gets POP settings' implies a read-only operation, but it doesn't specify what POP settings include, whether authentication is required, potential rate limits, or the format of the returned data. This is a significant gap for a tool with no annotation coverage, leaving the agent with minimal behavioral context.

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 a single, efficient sentence with zero waste: 'Gets POP settings'. It is front-loaded and appropriately sized for a simple tool, making it easy to parse quickly without unnecessary elaboration.

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 tool's simplicity (0 parameters, no output schema, no annotations), the description is minimal but insufficient. It lacks details on what POP settings entail, how the data is returned, or any behavioral traits. For a tool that likely retrieves configuration data, more context would help the agent understand the scope and use case, especially with many sibling tools.

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 0 parameters with 100% coverage, meaning no parameters need documentation. The description doesn't add parameter details, which is appropriate here. A baseline of 4 is applied because the schema fully handles the parameter semantics, and the description doesn't need to compensate for any gaps.

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 'Gets POP settings' clearly states the action (get) and resource (POP settings), which is adequate for understanding the basic purpose. However, it doesn't distinguish this tool from other 'get_' siblings like 'get_auto_forwarding' or 'get_imap' that also retrieve settings, leaving the specific scope vague. It avoids being a tautology by specifying 'POP settings' rather than just restating the name.

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?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'update_pop' and other 'get_' tools for different settings (e.g., 'get_auto_forwarding'), there is no indication of context, prerequisites, or exclusions. This lack of guidance makes it harder for an agent to choose correctly among similar tools.

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

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