fetch_data
Automatically selects the best Sugra API endpoint for your natural-language query and retrieves the data in one step. Provide required parameters to get results or receive a list of missing parameters to refine your request.
Instructions
One-step fetch: find the best Sugra endpoint for the query and call it.
Combines search_endpoints + call_endpoint into a single round trip. Use this when you want data without manually picking an operation_id. The full search_endpoints + describe_endpoint + call_endpoint dance is still available when you need explicit control, but for most natural-language queries this tool is enough.
Behavior:
Search the bundled catalog for the query. Top match wins.
If the matched endpoint has required parameters and they are all provided in
params, call it and return the response.If required parameters are missing, return the candidate endpoints and the missing-params list so the LLM can retry with the correct
paramsdict on the next call.
Examples:
fetch_data("US CPI inflation", params={"series_id": "CPIAUCSL"})→ calls /api/v1/fred/series/CPIAUCSL, returns observations.fetch_data("Bitcoin price", params={"coin_id": "bitcoin"})→ calls /api/v1/crypto/bitcoin/price.fetch_data("Latest financial news")→ news_latest has no required params, returns latest news directly.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | JSON body for an auto-selected POST operation; the tool returns the request_body_schema to fill when the match needs one. Pass a JSON object or a JSON array as that schema's top-level type dictates. | |
| limit | No | Bounds ONLY the top-level list: the envelope data list (or a bare top-level array). Nested lists inside records are never truncated; meta.shaped reports whether the limit applied. | |
| query | Yes | Natural-language request for data (examples: 'US CPI', 'Bitcoin price', 'latest news'). The tool picks the top catalog match and calls it. If required params are missing it returns needs_params instead of guessing. | |
| fields | No | Optional projection of keys to keep on each record. Dotted paths (geo.city) walk nested objects. meta.shaped reports fields_applied and fields_unmatched. Omit to keep every key. | |
| params | No | Parameters for the auto-selected endpoint. If omitted and the best-match endpoint has required parameters, the tool returns that endpoint's required_parameters and examples so you can retry with them filled in. | |
| include_raw | No | If true, attach the original unshaped payload under raw when it fits the size cap; otherwise meta.raw_omitted explains why. Default false. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||