Skip to main content
Glama

get_documents

Retrieve policy documents like declarations pages and contracts from Lemonade insurance by providing policy ID and email address.

Instructions

Retrieve policy documents from Lemonade (declarations page, policy contract, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
policy_idYesThe policy ID to get documents for
document_typeNoType of document to retrieve
emailYesEmail address associated with the policy

Implementation Reference

  • The handler function `handleGetDocuments` that implements the logic for the `get_documents` tool.
    async function handleGetDocuments(args: {
      policy_id: string;
      document_type?: string;
      email: string;
    }): Promise<string> {
      return withBrowser(async (browser, page) => {
        await page.goto(`${LEMONADE_BASE_URL}/login`, {
          waitUntil: "domcontentloaded",
          timeout: 30000,
        });
        await page.waitForTimeout(1500);
    
        const docType = args.document_type || "all";
        const docDescriptions: Record<string, string> = {
          declarations: "Declarations page showing your coverage summary",
          contract: "Full policy contract with terms and conditions",
          id_card: "Insurance ID card",
          all: "All available policy documents",
        };
    
        return JSON.stringify({
          status: "action_required",
          message: "Document access requires authentication.",
          policy_id: args.policy_id,
          document_type: docType,
          document_description: docDescriptions[docType] || docDescriptions.all,
          instructions: [
            `1. Visit ${LEMONADE_BASE_URL}/login`,
            `2. Sign in with: ${args.email}`,
            "3. Navigate to 'My Policy' > 'Documents'",
            `4. Select policy: ${args.policy_id}`,
            `5. Download: ${docDescriptions[docType] || "your documents"}`,
            "",
            "Documents are also emailed to you when your policy is issued or renewed.",
          ],
        });
      });
    }
  • The registration schema for the `get_documents` tool.
    {
      name: "get_documents",
      description:
        "Retrieve policy documents from Lemonade (declarations page, policy contract, etc.)",
      inputSchema: {
        type: "object",
        properties: {
          policy_id: {
            type: "string",
            description: "The policy ID to get documents for",
          },
          document_type: {
            type: "string",
            enum: ["declarations", "contract", "id_card", "all"],
            description: "Type of document to retrieve",
          },
          email: {
            type: "string",
            description: "Email address associated with the policy",
          },
        },
        required: ["policy_id", "email"],
      },
    },
  • src/index.ts:559-561 (registration)
    The tool dispatcher logic calling `handleGetDocuments` when `get_documents` is invoked.
    case "get_documents":
      result = await handleGetDocuments(args as Parameters<typeof handleGetDocuments>[0]);
      break;
Behavior2/5

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

No annotations provided, so description carries full disclosure burden. While it lists document types, it fails to specify return format (URL, base64, email attachment?), idempotency, or sensitivity handling. The email requirement implies verification occurs, but this isn't explained.

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?

Single, efficient sentence with action verb front-loaded. Parenthetical examples are high-information and zero waste. Appropriate length for the tool's complexity.

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

Completeness3/5

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

Adequate for parameter documentation given 100% schema coverage, but lacks critical behavioral context: no output schema exists, yet the description doesn't explain what the tool returns (download link, document content, or email trigger), which is essential for invocation confidence.

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?

Schema coverage is 100%, establishing baseline 3. Description adds value by mapping technical enum values to user-friendly examples ('declarations page' vs 'declarations') and providing provider context (Lemonade) that clarifies the policy_id domain.

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?

Specific verb (Retrieve) + resource (policy documents) + provider context (Lemonade) + concrete examples (declarations page, policy contract) clearly distinguish this from sibling tools like view_policy (which likely returns metadata rather than actual documents).

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

Usage Guidelines3/5

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

Provides implied usage context (when you need policy documents), but lacks explicit when-to-use guidance versus alternatives like view_policy, and doesn't specify prerequisites or exclusions (e.g., whether policy must be active).

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/markswendsen-code/mcp-lemonade'

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