Skip to main content
Glama

meta_refresh_token

Refresh long-lived access tokens before expiration to maintain continuous API access for Instagram Graph, Threads, and Meta platform operations.

Instructions

Refresh a long-lived token before it expires. Returns a new long-lived token.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
long_lived_tokenYesCurrent long-lived access token to refresh

Implementation Reference

  • The implementation of the meta_refresh_token MCP tool, which registers the tool handler using server.tool and calls client.refreshToken to process the request.
    server.tool(
      "meta_refresh_token",
      "Refresh a long-lived token before it expires. Returns a new long-lived token.",
      {
        long_lived_token: z.string().describe("Current long-lived access token to refresh"),
      },
      async ({ long_lived_token }) => {
        try {
          const { data, rateLimit } = await client.refreshToken(long_lived_token);
          return { content: [{ type: "text", text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] };
        } catch (error) {
          return { content: [{ type: "text", text: `Token refresh failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true };
        }
      }
    );
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the action ('Refresh') and outcome ('Returns a new long-lived token'), but lacks details on permissions, rate limits, error conditions, or whether the old token remains valid. For a mutation tool with zero annotation coverage, this is insufficient.

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—it directly states the purpose and outcome without redundancy. It's front-loaded with the core action, making it easy for an agent to parse quickly.

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 complexity (a mutation with security implications), lack of annotations, and no output schema, the description is incomplete. It doesn't cover error handling, authentication needs, or the format of the returned token, leaving significant gaps for safe and effective use.

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 description coverage is 100%, so the input schema already documents the 'long_lived_token' parameter fully. The description adds no additional semantic context beyond what the schema provides, such as token format or validation rules, meeting the baseline of 3 for high schema coverage.

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

Purpose4/5

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

The description clearly states the verb ('Refresh') and resource ('a long-lived token'), specifying the action and target. It distinguishes itself from siblings like 'meta_exchange_token' by focusing on refreshing existing tokens rather than exchanging short-lived ones. However, it doesn't explicitly contrast with all possible alternatives, keeping it at a 4.

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 minimal guidance, stating 'before it expires' as a timing hint but not specifying when exactly to use it (e.g., based on token age or error responses). It doesn't mention alternatives like 'meta_exchange_token' or clarify prerequisites, leaving the agent with little contextual direction.

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/mikusnuz/meta-mcp'

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