Skip to main content
Glama
Facebook Pages MCP Server

Facebook Pages MCP Server

by asrrin29

facebook_pages_refresh_token

Exchange an unexpired User access token for a Page token that does not expire, then use it for subsequent Facebook Pages API calls.

Instructions

Mint a Page access token that does not expire, and use it now Exchange a User access token for a long-lived one with the app's credentials, read me/accounts with it, and use the Page token that returns for every later call in this process. A Page token taken from a long-lived User token has no expiry, so this is how to stop the token expiring. Needs FB_APP_ID and FB_APP_SECRET, and a User token that has not expired: pass user_token, or have FB_USER_TOKEN set. The token is not written to the environment, so set FB_PAGE_TOKEN to keep it after a restart. Graph API: GET /oauth/access_token then GET me/accounts. A User token cannot be exchanged after it has expired; a new one must be obtained from the Graph API Explorer. The App Secret is sent only to the token exchange, never with a Page call.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "facebook_pages_refresh_token"
  }
}

Input Schema

NameRequiredDescriptionDefault
app_idNo
page_idNo
app_secretNo
user_tokenNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.6.1

TDQS

A3.8/5.0
Behavior5/5

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

No annotations are supplied, so the description carries the full disclosure burden, which it does: it names the required auth (FB_APP_ID, FB_APP_SECRET, live User token), states the side effect that the token is not persisted to the environment, and reassures that the App Secret is sent only during the exchange. It also exposes the underlying Graph API calls (GET /oauth/access_token then GET me/accounts), so the agent knows live external requests occur.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded and almost every sentence carries needed information, but the opening runs two clauses together without a sentence break ('...does not expire, and use it now Exchange a User access token...'), which hurts readability. It is dense rather than padded, but the structure works against easy scanning.

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?

Since an output schema exists, return values need not be explained. The description covers the auth, the external calls, the persistence caveat, and the expired-token failure mode; only the mapping from page_id/app_id/app_secret arguments to the exchange is missing, which is what keeps it short of full completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% and none of the four parameters carry descriptions, so the description has to explain them all. It covers only user_token (pass it, or rely on FB_USER_TOKEN), while app_id, app_secret and especially page_id are never mapped to arguments (the page_id gap is serious, because it is the only way to scope which Page's token is minted). Env-var fallbacks are mentioned, but this is thin for a 4-parameter schema with 0% 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 opens with a specific verb and resource: 'Mint a Page access token that does not expire.' The token-exchange flow (User token -> long-lived -> me/accounts -> Page token) is concrete enough to distinguish this from the sibling token tools, although it never names them explicitly.

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?

It states the situation that selects this tool ('this is how to stop the token expiring') and how to recover when the precondition fails ('A User token cannot be exchanged after it has expired; a new one must be obtained from the Graph API Explorer'). This is clear guidance on when and when-not to use it, with no explicit routing to a sibling alternative such as set_token.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.