Skip to main content
Glama
TylerFlar

claude-fidelity-mcp

by TylerFlar

fidelity_screenshot

Capture a screenshot of a Fidelity Investments page to verify account data or debug unexpected results from trading tools. Optionally navigate to a specific URL first.

Instructions

Take a screenshot of the current Fidelity browser page. Useful for debugging when tools return unexpected results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoOptional URL to navigate to before taking the screenshot. If omitted, captures the current page.

Implementation Reference

  • src/index.ts:490-539 (registration)
    Registers the 'fidelity_screenshot' tool on the MCP server with Zod schema for optional 'url' parameter and handler that takes a screenshot.
    server.tool(
      "fidelity_screenshot",
      "Take a screenshot of the current Fidelity browser page. Useful for debugging when tools return unexpected results.",
      {
        url: z
          .string()
          .optional()
          .describe(
            "Optional URL to navigate to before taking the screenshot. If omitted, captures the current page."
          ),
      },
      async ({ url }) => {
        try {
          const page = await getPage();
    
          if (url) {
            await page.goto(url, { waitUntil: "domcontentloaded" });
            const { waitForLoadingCompleteDouble } = await import("./browser.js");
            await waitForLoadingCompleteDouble(page, 30000);
          }
    
          const screenshotBuffer = await page.screenshot({ fullPage: true });
          const base64 = screenshotBuffer.toString("base64");
    
          return {
            content: [
              {
                type: "text",
                text: `Screenshot of: ${page.url()}`,
              },
              {
                type: "image",
                data: base64,
                mimeType: "image/png",
              },
            ],
          };
        } catch (e) {
          return {
            content: [
              {
                type: "text",
                text: `Screenshot failed: ${e instanceof Error ? e.message : String(e)}`,
              },
            ],
            isError: true,
          };
        }
      }
    );
  • The handler function that gets the browser page, optionally navigates to a URL, waits for loading to complete, takes a full-page screenshot, and returns it as base64-encoded image.
    async ({ url }) => {
      try {
        const page = await getPage();
    
        if (url) {
          await page.goto(url, { waitUntil: "domcontentloaded" });
          const { waitForLoadingCompleteDouble } = await import("./browser.js");
          await waitForLoadingCompleteDouble(page, 30000);
        }
    
        const screenshotBuffer = await page.screenshot({ fullPage: true });
        const base64 = screenshotBuffer.toString("base64");
    
        return {
          content: [
            {
              type: "text",
              text: `Screenshot of: ${page.url()}`,
            },
            {
              type: "image",
              data: base64,
              mimeType: "image/png",
            },
          ],
        };
      } catch (e) {
        return {
          content: [
            {
              type: "text",
              text: `Screenshot failed: ${e instanceof Error ? e.message : String(e)}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Zod schema defining the optional 'url' input parameter with description.
    {
      url: z
        .string()
        .optional()
        .describe(
          "Optional URL to navigate to before taking the screenshot. If omitted, captures the current page."
        ),
    },
  • The getPage() helper function used by the handler to retrieve the current browser page; throws if browser not initialized.
    export async function getPage(): Promise<Page> {
      if (!page || page.isClosed()) {
        throw new Error(
          "Browser not initialized. Call fidelity_login first."
        );
      }
      return page;
    }
Behavior3/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. It states the core action (screenshot) and optional navigation, but does not disclose potential side effects (e.g., page state changes, browser window behavior) or limitations.

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?

Two concise sentences with no redundant information. Every phrase adds value.

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?

For a simple screenshot tool with no output schema, the description covers purpose and basic usage. Could optionally mention return format (e.g., base64 image), but not critical.

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?

Schema coverage is 100% with one parameter 'url' well-described. The description adds context by explaining the optional URL behavior, but does not exceed the schema's clarity.

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 tool's action ('Take a screenshot') and context ('current Fidelity browser page'), with a specific use case (debugging). It distinguishes from siblings, none of which are screenshot tools.

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?

The description mentions it is 'useful for debugging when tools return unexpected results,' providing some guidance on when to use. However, it lacks explicit instructions on when not to use or mention of alternative 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/TylerFlar/claude-fidelity-mcp'

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