Search Within a Source
search_withinSemantic search INSIDE a fetched record. Pass the text you already pulled (e.g. a SEC 10-K body, an article, a long tool result) plus a natural-language query; get back the top-N passages with character offsets and similarity scores. Use when the record is too big to cram into the prompt — search_within saves context, returns only the passages that matter, and every passage carries an offset so the agent can verify a verbatim quote. Pairs with ask_pipeworx_grounded: fetch with the gateway, ground over the relevant passages instead of the whole document. BGE-base-en embeddings + cosine over 500-char overlapping windows; cap is 200K chars (longer inputs are truncated and flagged).
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"text": "Apple Inc. reported fiscal 2023 revenue of $383.285 billion, driven by strong iPhone and Services growth. Net income was $96.995 billion. The company faced supply-chain risk in China during the quarter.",
"query": "supply-chain risk"
},
"name": "search_within"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The document text to search inside (max ~200K chars). | |
| limit | No | Max passages to return (1-20, default 5). | |
| query | Yes | Natural-language query — what passages do you want? E.g. "supply-chain risk", "fiscal year 2024 revenue", "drug interactions with warfarin". |