Skip to main content
Glama
dhawalshah

meta-ads-mcp

fetch_pagination_url

Retrieve the next or previous page of results by providing a pagination URL from a Meta Ads insights API response.

Instructions

Fetch data from a Facebook Graph API pagination URL

Use this to get the next/previous page of results from an insights API call.

Args: url: The complete pagination URL (e.g., from response['paging']['next'] or response['paging']['previous']). It includes the necessary token and parameters.

Returns: The dictionary containing the next/previous page of results.

Example: ```python # Assuming 'initial_results' is the dict from a previous insights call if "paging" in initial_results and "next" in initial_results["paging"]: next_page_data = fetch_pagination_url(url=initial_results["paging"]["next"])

if "paging" in initial_results and "previous" in initial_results["paging"]:
    prev_page_data = fetch_pagination_url(url=initial_results["paging"]["previous"])
```

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

No annotations are provided, so the description carries the behavioral disclosure burden. It explains that the URL already includes the necessary token and parameters, that the tool returns a dictionary with the next/previous page, and shows how to safely check for paging keys in a previous result. This is sufficient for a simple read-only pagination fetch.

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 well-structured with a one-sentence purpose, an Args section, a Returns section, and a practical Python example. Every part adds value, and the content is front-loaded with the core purpose before technical details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter pagination helper, the description covers the purpose, the source of the URL, the return type, and a realistic usage example. It also connects the tool to its sibling insights tools by referencing the paging field from a prior insights call.

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

Parameters5/5

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

Schema coverage is 0% and the schema only lists 'url' with a title. The description fully compensates by explaining the parameter is the complete pagination URL, giving concrete examples such as response['paging']['next'], and noting it includes token and parameters.

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 begins with a specific verb and resource: 'Fetch data from a Facebook Graph API pagination URL.' It clearly states the tool is for getting the next/previous page of insights API results, which differentiates it from the many insights-list siblings that fetch initial data.

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 clearly states when to use the tool: to retrieve the next or previous page from a prior insights API call. It does not explicitly name alternatives or exclusions, but the usage context is unambiguous and the example reinforces the intended flow.

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