Documentation / MCP / docs_search

docs_search

POSThttps://mcp.oppalerts.com/mcptool: docs_search

Search the OppAlerts documentation by words, by semantic similarity, or both.

Search the OppAlerts documentation from your AI agent, and find the page that answers a question about a tool, a field, a limit, an error, or a task. docs_search takes query, words with the search operators, and similarity_text, a question or a description in plain language of at most 200 words. Each result has the path, the title, and the 2 addresses of the page, url_html and url_md. Send a path to docs_get to read the whole page as markdown.

What it does

The tool searches every page of the OppAlerts documentation: the guides, the how-to guides, the pages of the web app, and the MCP page and the API page of each tool. It searches by words, by semantic similarity, or both.

  • query is a word search. The words match the title and the text of each page together. It takes the search operators of title_query of news_search, with the same rules. The results are in the order of the word match, and each result has a relevance_weight.
  • similarity_text is a search by meaning. Write a question or a description in plain language, at most 200 words. The results are in the order of similarity, and each result has a similarity_score from 0 to 100.
  • Send both, and the words choose the pages, and similarity sets the order.
  • The code samples of a page (the JSON and the curl lines) are not searched. Text that more than 10 pages share is not searched either.
  • The MCP page and the API page of 1 tool are 1 result: the page that ranks first, with the other page in paired_page. paired_page is null for every other page.
  • similarity_score is null when you send no similarity_text, and relevance_weight is null when you send no query.

To read a page, send its path to docs_get.

Connect

claude mcp add --transport http oppalerts https://mcp.oppalerts.com/mcp

The first call opens a browser window for the OppAlerts login. Connect an AI Agent has the details.

Parameters

querystring, optional, at most 500 characters
Words a page must have, matched against the title and the text of the page together. It takes these search operators: AND, OR, MAYBE, NEAR/N, and NOTNEAR/N in capitals, the Negation operator (-), the Phrase search operator, the Proximity search operator (~N), the Exact form modifier (=), the IDF boost modifier (^N), the Wildcard operator (* at the end of a word), and Grouping with parentheses (one level). Advanced Search Operators has the full list. At most 20 words or phrases. Not sent: no words.
similarity_textstring, optional, at most 200 words and 8,192 bytes
A question or a description in plain language that the pages must be near to in semantic similarity. A longer text is refused, and nothing is cut. Not sent: no vector.
sectionslist of strings, optional, at most 12 items
The sections of the documentation to search: docs-getting-started, docs-how-to, docs-use-cases, docs-opportunity-types, docs-content-types, docs-the-data, docs-app, docs-mcp, docs-api, docs-account, docs-free-pagerank-api, and docs-faq. Not sent: all sections.
results_limitinteger, optional, 1 to 50
The most results. Not sent: 10.

Strict Rules

  • A field that is not in the list above is refused. The result then has isError true, and its text starts with bad_param. The error names the field: "<field> is not a field of this tool."
  • A bad value is refused, and the error names the field. A bad value is a value of the wrong type, a number with a fraction for a whole-number field, a value out of its range, an empty text, or a value that is not in its list. A required field that you do not send is refused too. The tool never changes a value that you send.
  • Send query, similarity_text, or both. A call with neither is refused: "This tool needs words or a text: send query, similarity_text, or both."
  • A similarity_text of more than 200 words is refused, and nothing is cut: "similarity_text has 201 words. The most is 200 words: send a shorter text. Nothing is cut."
  • A wrong use of a search operator in query is refused with a sentence that names the field, for example "query has a formatting error: OR needs a word on each side." How to Search the Indexes has every rule of a query.
  • A value of sections that is not in the list is refused, and the error lists the sections.
  • An error about the format of a call, such as a refused field, names the field. Its message ends with one sentence: "Read the documentation at https://oppalerts.com/docs for the correct format." Every other error has only its own sentence.

Example

Call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "docs_search",
    "arguments": {
      "query": "calls left",
      "similarity_text": "how many calls do I have left today",
      "results_limit": 3
    }
  }
}

Response

The full sample answer, a call with query and similarity_text.

{
  "returned": 3,
  "results": [
    {
      "path": "docs/account/usage.md",
      "section": "docs-account",
      "title": "Usage",
      "url_html": "https://oppalerts.com/docs/account/usage",
      "url_md": "https://oppalerts.com/docs/account/usage.md",
      "paired_page": null,
      "similarity_score": 76.085132,
      "relevance_weight": 8521.0
    },
    {
      "path": "docs/mcp/account_calls_left.md",
      "section": "docs-mcp",
      "title": "account_calls_left",
      "url_html": "https://oppalerts.com/docs/mcp/account_calls_left",
      "url_md": "https://oppalerts.com/docs/mcp/account_calls_left.md",
      "paired_page": {
        "path": "docs/api/account_calls_left.md",
        "section": "docs-api",
        "url_html": "https://oppalerts.com/docs/api/account_calls_left",
        "url_md": "https://oppalerts.com/docs/api/account_calls_left.md"
      },
      "similarity_score": 74.175066,
      "relevance_weight": 8533.0
    },
    {
      "path": "docs/getting-started/usage-and-daily-limits.md",
      "section": "docs-getting-started",
      "title": "Usage and Daily Limits",
      "url_html": "https://oppalerts.com/docs/getting-started/usage-and-daily-limits",
      "url_md": "https://oppalerts.com/docs/getting-started/usage-and-daily-limits.md",
      "paired_page": null,
      "similarity_score": 73.629361,
      "relevance_weight": 8527.0
    }
  ]
}

Errors

An error returns as a tool result with isError true. Its text starts with the error code, except for daily_limit, whose text is only the sentence. The HTTP status shown for each code is its API status.

  • bad_param (HTTP 400 in the API): a field is missing, has a wrong value, or is not a field of this tool. The error names the field.
  • search_stopped (HTTP 422 in the API): the search took more than 10 seconds and was stopped.
  • backend_error (HTTP 502 in the API): the documentation search did not answer. Send the call again after a few seconds.
  • daily_limit (HTTP 429 in the API): the account has used all its calls for this tool today. account_calls_left shows when the count resets.

This tool has its own daily count: 3,000 calls a day on a paid plan and 500 on the free plan. It is not an index search, so it does not use the shared count of the news_ and prospects_ tools, and the error one_at_a_time does not apply to it.

Same data in the API

POST /v1/docs/search HTTP/1.1
Host: api.oppalerts.com
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{"query":"calls left","similarity_text":"how many calls do I have left today","results_limit":3}

The API page is POST /v1/docs/search.