search_code
Locate code by behavior or identifier using plain-English queries, returning ranked snippets, symbols, and wiki pages from indexed repositories.
Instructions
Find code by what it does or by name: "how are requests routed?", "where are sessions saved?", "url_for". Use this first when you do not yet know which symbol to look at. If you already know the name, use get_symbol to read it, find_callers for its call sites, or impact_of for what a change would affect. Returns up to limit hits (default 10), best first. Each hit has the repository, path, symbol name, kind, language, line range, a snippet of the symbol's opening lines, and the scores behind its rank: the score, the relevance (the score before feedback), the feedback boost, the keyword rank and the semantic rank (null when that side did not find it). The feedback field is the boost from earlier sessions marking the result used: at most 0.2 (20 percent), fading over 30 days; relevance is the score before it. Keyword and semantic search are fused, and the definitions of an exact identifier come first. A hit of kind page is a wiki page about a whole module: its name is the page name, its path is the module's directory, its line range is null and its state says whether it is fresh or stale; read it with read_wiki. A hit of kind fact is something an earlier session worked out about the code at its path; recall lists all of them. Next step: call get_symbol with a hit's name to read its full source, or read_wiki with a page hit's name.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | No | Search only this registered repository, for example flask. list_repositories gives the valid names. Default: all repositories. | |
| limit | No | How many hits to return, 1 to 50. Default 10. | |
| query | Yes | A question in plain English (how are requests routed) or an identifier (url_for). Taken literally; there is no query syntax. | |
| feedback | No | Raise results that earlier sessions used, by at most 20 percent of their score. false ranks by relevance alone, exactly as with no feedback recorded. Default true. | |
| language | No | Search only files of this language: one of batch, c, cpp, csharp, css, go, html, ini, java, javascript, json, kotlin, markdown, php, proto, python, rst, ruby, rust, shell, sql, swift, text, toml, tsx, typescript, yaml. Default: all languages. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reason | Yes | ||
| status | Yes | ||
| results | Yes |