Skip to main content
Glama

help

Read-onlyIdempotent

Access detailed documentation for Better Email MCP tools to understand their functionality and usage requirements.

Instructions

Get full documentation for a tool. Use when compressed descriptions are insufficient.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tool_nameYesTool to get documentation for

Implementation Reference

  • Handler for the 'help' tool that validates the tool name, reads the corresponding documentation file, and returns the tool name and documentation content
    case 'help': {
      const toolName = (args as { tool_name: string }).tool_name
      if (!isValidToolName(toolName)) {
        throw new EmailMCPError(
          `Invalid tool name: ${toolName}`,
          'VALIDATION_ERROR',
          'Valid: messages, folders, attachments, send, help'
        )
      }
      const resource = RESOURCES.find((r) => r.uri === `email://docs/${toolName}`)
      if (!resource) {
        throw new EmailMCPError(`Documentation not found for: ${toolName}`, 'DOC_NOT_FOUND', 'Check tool_name')
      }
      try {
        const content = await readFile(join(DOCS_DIR, resource.file), 'utf-8')
        result = { tool: toolName, documentation: content }
      } catch {
        throw new EmailMCPError(`Documentation not found for: ${toolName}`, 'DOC_NOT_FOUND', 'Check tool_name')
      }
      break
    }
  • Schema definition for the 'help' tool including name, description, annotations, and inputSchema with tool_name parameter
    {
      name: 'help',
      description: 'Get full documentation for a tool. Use when compressed descriptions are insufficient.',
      annotations: {
        title: 'Help',
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: false
      },
      inputSchema: {
        type: 'object',
        properties: {
          tool_name: {
            type: 'string',
            enum: ['messages', 'folders', 'attachments', 'send', 'help'],
            description: 'Tool to get documentation for'
          }
        },
        required: ['tool_name']
      }
    }
  • Registration function that sets up all tools including 'help' with the MCP server via CallToolRequestSchema handler
    export function registerTools(server: Server, accounts: AccountConfig[]) {
      server.setRequestHandler(ListToolsRequestSchema, async () => ({
        tools: TOOLS
      }))
    
      // Resources handlers for full documentation
      server.setRequestHandler(ListResourcesRequestSchema, async () => ({
        resources: RESOURCES.map((r) => ({
          uri: r.uri,
          name: r.name,
          mimeType: 'text/markdown'
        }))
      }))
    
      server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
        const { uri } = request.params
        const resource = RESOURCES.find((r) => r.uri === uri)
    
        if (!resource) {
          throw new EmailMCPError(
            `Resource not found: ${uri}`,
            'RESOURCE_NOT_FOUND',
            `Available: ${RESOURCES.map((r) => r.uri).join(', ')}`
          )
        }
    
        const content = await readFile(join(DOCS_DIR, resource.file), 'utf-8')
        return {
          contents: [{ uri, mimeType: 'text/markdown', text: content }]
        }
      })
    
      server.setRequestHandler(CallToolRequestSchema, async (request) => {
        const { name, arguments: args } = request.params
    
        if (!args) {
          return {
            content: [
              {
                type: 'text',
                text: 'Error: No arguments provided'
              }
            ],
            isError: true
          }
        }
    
        try {
          let result
    
          switch (name) {
            case 'messages':
              result = await messages(accounts, args as unknown as MessagesInput)
              break
            case 'folders':
              result = await folders(accounts, args as unknown as FoldersInput)
              break
            case 'attachments':
              result = await attachments(accounts, args as unknown as AttachmentsInput)
              break
            case 'send':
              result = await send(accounts, args as unknown as SendInput)
              break
            case 'help': {
              const toolName = (args as { tool_name: string }).tool_name
              if (!isValidToolName(toolName)) {
                throw new EmailMCPError(
                  `Invalid tool name: ${toolName}`,
                  'VALIDATION_ERROR',
                  'Valid: messages, folders, attachments, send, help'
                )
              }
              const resource = RESOURCES.find((r) => r.uri === `email://docs/${toolName}`)
              if (!resource) {
                throw new EmailMCPError(`Documentation not found for: ${toolName}`, 'DOC_NOT_FOUND', 'Check tool_name')
              }
              try {
                const content = await readFile(join(DOCS_DIR, resource.file), 'utf-8')
                result = { tool: toolName, documentation: content }
              } catch {
                throw new EmailMCPError(`Documentation not found for: ${toolName}`, 'DOC_NOT_FOUND', 'Check tool_name')
              }
              break
            }
            default:
              throw new EmailMCPError(
                `Unknown tool: ${name}`,
                'UNKNOWN_TOOL',
                `Available tools: ${TOOLS.map((t) => t.name).join(', ')}`
              )
          }
    
          const jsonText = JSON.stringify(result, null, 2)
          return {
            content: [
              {
                type: 'text',
                text: wrapToolResult(name, jsonText)
              }
            ]
          }
        } catch (error) {
          const enhancedError = error instanceof EmailMCPError ? error : enhanceError(error)
    
          return {
            content: [
              {
                type: 'text',
                text: aiReadableMessage(enhancedError)
              }
            ],
            isError: true
          }
        }
      })
    }
  • isValidToolName validation function used by 'help' tool to prevent path traversal attacks by checking against valid tool names
    /** Validate tool name for help documentation requests */
    export function isValidToolName(name: string): boolean {
      return VALID_TOOL_NAMES.has(name)
    }
Behavior4/5

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

The description adds valuable context beyond what annotations provide. While annotations indicate readOnlyHint=true, idempotentHint=true, and destructiveHint=false, the description clarifies that this tool provides 'full documentation' when regular descriptions are insufficient. This adds meaningful behavioral context about the tool's purpose and output.

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 perfectly concise with two sentences that each serve distinct purposes: the first states what the tool does, the second provides usage guidance. There's zero wasted language and it's front-loaded with the core functionality.

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

Completeness4/5

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

Given the tool's simple purpose (retrieving documentation), single parameter with full schema coverage, and comprehensive annotations, the description is mostly complete. However, it doesn't describe what format the 'full documentation' returns (e.g., markdown, HTML, plain text), which would be helpful since there's no output schema.

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

Parameters3/5

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

With 100% schema description coverage, the input schema already fully documents the single parameter 'tool_name' with its enum values. The description doesn't add any additional parameter semantics beyond what the schema provides, so the baseline score of 3 is appropriate.

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

Purpose5/5

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

The description clearly states the specific action ('Get full documentation') and resource ('for a tool'), distinguishing it from sibling tools like 'messages', 'folders', 'attachments', and 'send' which perform different operations. It explicitly defines its unique purpose in the tool ecosystem.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool: 'Use when compressed descriptions are insufficient.' This clearly differentiates it from the default tool descriptions and provides a specific trigger condition for its usage.

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/n24q02m/better-email-mcp'

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