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 };
        }
      }
    );

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