TOOL CALLING
Generate news search tools
These tool definitions are generated at build time from the GET /v1/articles query parameters in the OpenAPI contract. The parameter names, types, descriptions, enums, and defaults come from that source.
OpenAI function schema
{
"type": "function",
"function": {
"name": "searchArticles",
"description": "Search articles",
"parameters": {
"type": "object",
"properties": {
"q": {
"type": "string",
"description": "Search syntax (max 500 characters): quoted phrases, AND/OR/NOT and parentheses; max 10 boolean operators."
},
"search_in": {
"type": "string",
"description": "Comma-separated fields to search: title, description, content. Content search is available on every plan."
},
"domains": {
"type": "string",
"description": "Include up to 10 publisher domains; matching includes subdomains."
},
"exclude_domains": {
"type": "string",
"description": "Exclude up to 10 publisher domains; matching includes subdomains."
},
"region": {
"type": "string",
"description": "Case-insensitive article region filter (maximum 100 characters)."
},
"dedupe": {
"type": "boolean",
"description": "Keep one article per story, selecting the highest trust score.",
"default": false
},
"cursor": {
"type": "string",
"description": "Opaque nextPageToken from the previous response; continue after exactly the articles returned."
},
"country": {
"type": "string",
"description": "Comma-separated ISO 3166-1 alpha-2 codes (max 10, case-insensitive). Matches any of them."
},
"language": {
"type": "string",
"description": "Comma-separated ISO 639-1 codes (max 10, case-insensitive). Matches any of them."
},
"category": {
"type": "string",
"description": "Comma-separated categories (max 10, each 1–50 characters). Matches articles having any of them (case-insensitive, exact match)."
},
"author": {
"type": "string",
"description": "Case-insensitive substring match on the article author (max 100 characters)."
},
"from": {
"type": "string",
"description": "Oldest `publishedAt` to include (inclusive), UTC. Either a date `YYYY-MM-DD` (00:00:00 UTC that day) or a\ndatetime: RFC 3339 with `Z` or an offset (URL-encode `+` as `%2B`), optional fractional seconds, or\n`YYYY-MM-DDTHH:MM[:SS]` without offset (interpreted as UTC). Must be earlier than `to`.\n"
},
"to": {
"type": "string",
"description": "Newest `publishedAt` to include (inclusive), UTC. Same formats as `from`; a date-only value includes the\nwhole day (up to 23:59:59.999999 UTC).\n"
},
"indexed_from": {
"type": "string",
"description": "ISO-8601 date or datetime (inclusive). Filters on `created_at`, the time this article version was last indexed. Use with `sort=indexed_desc` and the last seen `indexedAt` for incremental sync; repeat with an overlap window if your pipeline needs retries."
},
"sort": {
"type": "string",
"description": "Relevance (title hit > description hit > content hit, then recency), publication time, or indexed time.",
"enum": [
"relevance",
"published_desc",
"published_asc",
"indexed_desc"
],
"default": "published_desc"
},
"mode": {
"type": "string",
"description": "Ranking mode. `lexical` (default) is keyword search over the whole archive. `semantic` ranks by meaning\n(embedding similarity); `hybrid` fuses lexical and semantic ranks (reciprocal rank fusion). Both require `q`,\napply every other filter, sort by relevance only (`sort` must be omitted or `relevance`), do not support\n`dedupe`, return at most the first 200 results (offset plus `page_size` ≤ 200), and omit `totalResults`.\nSemantic coverage is limited to the most recently indexed article versions; the newest articles may\nnot be embedded yet (hybrid still finds them lexically). If the semantic index has not been built or\nits provider is unavailable the request fails with `503 serviceUnavailable`; it never falls back to\nlexical.\n",
"enum": [
"lexical",
"semantic",
"hybrid"
],
"default": "lexical"
},
"page": {
"type": "integer",
"description": "1-based page number.",
"default": 1
},
"page_size": {
"type": "integer",
"description": "Results per page; maximum 100 for every key. `page × page_size` must be ≤ 10,000.",
"default": 10
}
},
"required": [],
"additionalProperties": false
}
}
}Anthropic tool schema
{
"name": "searchArticles",
"description": "Search articles",
"input_schema": {
"type": "object",
"properties": {
"q": {
"type": "string",
"description": "Search syntax (max 500 characters): quoted phrases, AND/OR/NOT and parentheses; max 10 boolean operators."
},
"search_in": {
"type": "string",
"description": "Comma-separated fields to search: title, description, content. Content search is available on every plan."
},
"domains": {
"type": "string",
"description": "Include up to 10 publisher domains; matching includes subdomains."
},
"exclude_domains": {
"type": "string",
"description": "Exclude up to 10 publisher domains; matching includes subdomains."
},
"region": {
"type": "string",
"description": "Case-insensitive article region filter (maximum 100 characters)."
},
"dedupe": {
"type": "boolean",
"description": "Keep one article per story, selecting the highest trust score.",
"default": false
},
"cursor": {
"type": "string",
"description": "Opaque nextPageToken from the previous response; continue after exactly the articles returned."
},
"country": {
"type": "string",
"description": "Comma-separated ISO 3166-1 alpha-2 codes (max 10, case-insensitive). Matches any of them."
},
"language": {
"type": "string",
"description": "Comma-separated ISO 639-1 codes (max 10, case-insensitive). Matches any of them."
},
"category": {
"type": "string",
"description": "Comma-separated categories (max 10, each 1–50 characters). Matches articles having any of them (case-insensitive, exact match)."
},
"author": {
"type": "string",
"description": "Case-insensitive substring match on the article author (max 100 characters)."
},
"from": {
"type": "string",
"description": "Oldest `publishedAt` to include (inclusive), UTC. Either a date `YYYY-MM-DD` (00:00:00 UTC that day) or a\ndatetime: RFC 3339 with `Z` or an offset (URL-encode `+` as `%2B`), optional fractional seconds, or\n`YYYY-MM-DDTHH:MM[:SS]` without offset (interpreted as UTC). Must be earlier than `to`.\n"
},
"to": {
"type": "string",
"description": "Newest `publishedAt` to include (inclusive), UTC. Same formats as `from`; a date-only value includes the\nwhole day (up to 23:59:59.999999 UTC).\n"
},
"indexed_from": {
"type": "string",
"description": "ISO-8601 date or datetime (inclusive). Filters on `created_at`, the time this article version was last indexed. Use with `sort=indexed_desc` and the last seen `indexedAt` for incremental sync; repeat with an overlap window if your pipeline needs retries."
},
"sort": {
"type": "string",
"description": "Relevance (title hit > description hit > content hit, then recency), publication time, or indexed time.",
"enum": [
"relevance",
"published_desc",
"published_asc",
"indexed_desc"
],
"default": "published_desc"
},
"mode": {
"type": "string",
"description": "Ranking mode. `lexical` (default) is keyword search over the whole archive. `semantic` ranks by meaning\n(embedding similarity); `hybrid` fuses lexical and semantic ranks (reciprocal rank fusion). Both require `q`,\napply every other filter, sort by relevance only (`sort` must be omitted or `relevance`), do not support\n`dedupe`, return at most the first 200 results (offset plus `page_size` ≤ 200), and omit `totalResults`.\nSemantic coverage is limited to the most recently indexed article versions; the newest articles may\nnot be embedded yet (hybrid still finds them lexically). If the semantic index has not been built or\nits provider is unavailable the request fails with `503 serviceUnavailable`; it never falls back to\nlexical.\n",
"enum": [
"lexical",
"semantic",
"hybrid"
],
"default": "lexical"
},
"page": {
"type": "integer",
"description": "1-based page number.",
"default": 1
},
"page_size": {
"type": "integer",
"description": "Results per page; maximum 100 for every key. `page × page_size` must be ≤ 10,000.",
"default": 10
}
},
"required": [],
"additionalProperties": false
}
}Authentication
Tool schemas describe API search parameters only. Supply your API key from the server-side tool executor in the X-Api-Key header; for browser tests the REST API also accepts apiKey in the query string. Do not expose secrets in prompts or client-side code.
Stuck or found a mistake?Email developer support