Fetch External API Metrics (REST / GraphQL)
fetch_external_api_metricsFetches financial, SaaS, and advertising metrics from REST or GraphQL APIs with timeout, retry, SSRF protection, and environment-variable authentication.
Instructions
Typed REST/GraphQL client with timeout, exponential-backoff retries, SSRF protection, and env-var auth indirection for financial, SaaS, and advertising metrics.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"url": "<url>"
},
"name": "fetch_external_api_metrics"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Target HTTPS endpoint URL (financial, SaaS, or ads metrics API). | |
| body | No | Optional JSON request body for REST POST requests. | |
| mode | No | API protocol mode: REST or GraphQL. | rest |
| dryRun | No | When true, validates parameters and returns the sanitized request plan without calling the API. | |
| method | No | HTTP method for REST requests. GraphQL automatically uses POST. | GET |
| timeoutMs | No | Per-attempt HTTP timeout in milliseconds. | |
| authEnvVar | No | Environment variable name storing the API token/key (e.g., STRIPE_API_KEY, META_ADS_TOKEN). Keeps secrets out of LLM context. | |
| authScheme | No | Authorization header scheme when authEnvVar is provided. | Bearer |
| maxRetries | No | Maximum exponential-backoff retry attempts on 429/5xx/network errors. | |
| extractPath | No | Optional dot-notation path to extract a focused metric slice from the JSON response (e.g., 'data.summary'). | |
| queryParams | No | Optional URL query parameters for REST endpoints. | |
| extraHeaders | No | Optional non-secret request headers (e.g., Stripe-Version, X-Account-Id). | |
| graphqlQuery | No | GraphQL query or mutation document (required when mode='graphql'). | |
| authHeaderName | No | Header name for credentials (default: Authorization; e.g., X-API-Key for ApiKey). | Authorization |
| graphqlVariables | No | Optional variables object for GraphQL requests. |