Skip to main content
Glama

refresh

Reload a browser tab to update stale page state after changes. Use the tab ID from create_tab.

Instructions

Reload the current page. Useful when page state is stale or after changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tabIdYesTab ID from create_tab

Implementation Reference

  • Registration of the 'refresh' tool on the MCP server. Defines input schema (tabId string) and handler that calls client.refresh().
    server.tool(
      "refresh",
      "Reload the current page. Useful when page state is stale or after changes.",
      {
        tabId: z.string().min(1).describe("Tab ID from create_tab")
      },
      async (input: unknown) => {
        try {
          const parsed = z.object({ tabId: z.string().min(1).describe("Tab ID from create_tab") }).parse(input);
          const tracked = getTrackedTab(parsed.tabId);
          const action = await deps.client.refresh(parsed.tabId, tracked.userId);
          incrementToolCall(parsed.tabId);
          if (action.url) {
            updateTabUrl(parsed.tabId, action.url);
          }
          return okResult({
            success: true,
            url: action.url,
            title: action.title ?? "",
            refsAvailable: action.refsAvailable
          });
        } catch (error) {
          return toErrorResult(error);
        }
      }
    );
  • Handler function - sends POST request to /tabs/{tabId}/refresh API endpoint with userId in the body, returns url, title, and refsAvailable.
    async refresh(tabId: string, userId: string): Promise<NavigationActionResponse> {
      const response = await this.requestJson(`/tabs/${encodeURIComponent(tabId)}/refresh`, {
        method: "POST",
        body: JSON.stringify({ userId })
      }, NavigationActionRawResponseSchema);
    
      return {
        url: response.url ?? "",
        title: response.title,
        refsAvailable: response.refsAvailable
      };
    }
  • Zod schema for raw API response validation for refresh (and navigation) endpoints.
    const NavigationActionRawResponseSchema = z
      .object({
        url: z.string().optional(),
        title: z.string().optional(),
        refsAvailable: z.boolean().optional()
      })
      .passthrough();
  • TypeScript interface defining the shape of the refresh response.
    export interface NavigationActionResponse {
      url: string;
      title?: string;
      refsAvailable?: boolean;
    }
Behavior3/5

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

With no annotations, the description carries full burden. It indicates a reload operation but does not disclose whether it waits for completion, potential side effects (e.g., unsaved data loss), or if it's asynchronous.

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 two sentences long, efficient, and front-loaded with the core action. No fluff.

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 one-param tool with no output schema, the description covers purpose and usage context. It lacks details on return behavior or error handling, but is adequate for the complexity.

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?

Since schema coverage is 100% and the description adds no extra meaning beyond the schema's parameter description, it meets the baseline. No enrichment provided.

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 reloads the current page, using a specific verb and resource. It distinguishes itself from siblings like go_back and go_forward which navigate history.

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

Usage Guidelines4/5

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

The description mentions usefulness when page state is stale or after changes, giving clear context. However, it does not explicitly state when not to use or compare with alternatives.

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/redf0x1/camofox-mcp'

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