Request inputs
The CLI’s --input-json option supplies explicit input locations and JSON types to an API operation. Its value is an object containing path, query, header, or body.
You need an authenticated CLI and the API’s current contract. The examples below are request previews. They do not retrieve videos, stories, or restaurants.
- Read the input location and type.
- Preview the request with typed values.
- Execute the request when you need the data.
1. Read the input location and type
Section titled “1. Read the input location and type”Read the contracts for these APIs.
agent-data docs youtube-comagent-data docs news-ycombinator-comagent-data docs opentable-comyoutube-com, news-ycombinator-com, and opentable-com are readable API handles. Each identifies an API for that website.
Select an operation’s route slug from the contract. Read its parameters and request_body_contract.
| Operation | Input | Location and type |
|---|---|---|
YouTube search-videos | query | A required string in the query string. |
Hacker News feeds-by-feed | feed | A required path string containing a feed name. |
OpenTable restaurants-search | city | A required string in the query string. |
OpenTable restaurants-search | max_page_size, strict_location | An optional integer and boolean in the query string. |
2. Preview the correctly typed request
Section titled “2. Preview the correctly typed request”Query string
Section titled “Query string”agent-data call youtube-com search-videos \ --input-json '{"query":{"query":"python programming"}}' \ --dry-runThe outer query selects the location. The inner query names this endpoint’s input. The captured preview resolves GET /v1/search-videos?query=python+programming with no body.
Path parameter
Section titled “Path parameter”agent-data call news-ycombinator-com feeds-by-feed \ --input-json '{"path":{"feed":"news"}}' \ --dry-runThe feed name news selects the Hacker News front page. The preview replaces {feed} in /v1/feeds/{feed} with that name. See the captured feed response.
This CLI 0.13.0 excerpt from November 17, 2026 omits all headers.
{ "dry_run": true, "method": "GET", "url": "https://api.agent-data.dev/news-ycombinator-com/v1/feeds/news", "body": null}Numbers and booleans
Section titled “Numbers and booleans”agent-data call opentable-com restaurants-search \ --input-json '{"query":{"city":"San Francisco","max_page_size":3,"strict_location":true}}' \ --dry-runmax_page_size is an integer, and strict_location is a boolean. The CLI checks those JSON types before encoding the query string.
The November 17, 2026 preview returns this request. The excerpt omits all headers.
{ "dry_run": true, "method": "GET", "url": "https://api.agent-data.dev/opentable-com/v1/restaurants/search?city=San+Francisco&max_page_size=3&strict_location=true", "body": null}JSON body
Section titled “JSON body”For an operation with a JSON body, set body.contentType to application/json. Put its fields in body.value. Preserve the types required by the operation’s request_body_contract.
body.value becomes the request body. The surrounding object controls the CLI input format. The example operations above have no request body.
Header parameters
Section titled “Header parameters”The header object accepts input names from the operation’s contract. Use it only for headers that the contract defines. These example operations have no such header inputs.
The CLI supplies authentication separately. Do not put your API key in the input object.
3. Check and execute the request
Section titled “3. Check and execute the request”- Check
method,url, andbodyagainst the current contract. - Remove
--dry-runwhen you intend to make the data call. - Read the response using that API’s schema.
The previews establish request construction. The YouTube call supplies a complete example with a successful data response.
If validation fails
Section titled “If validation fails”| What you see | What to do |
|---|---|
| The CLI reports overlapping values. | Supply each parameter once, through the typed object or an ordinary flag. |
| A required field is missing. | Read the contract’s required inputs. Add the missing value. |
| The CLI rejects an input type. | Supply the JSON type from the contract. |
| The CLI reports an unsupported or missing contract. | Read input_contract_issues. Preserve the reported issue for support. |
Repeat the preview after the correction. The missing-query example shows an actual failure and correction.
Download the captured previews for exact inputs, timestamps, and selected outputs.
When to use HTTP or MCP
Section titled “When to use HTTP or MCP”HTTP sends values at their contract-defined locations. MCP uses the call tool’s arguments, which differ from the CLI’s typed object.