code_search
Search code, docs, and symbols across npm/PyPI/crates packages or public repositories. Filter by language, source type, and qualifiers to find relevant implementations and API usage.
Instructions
Search code, docs, and symbols across indexed dependencies and public repositories. Package scope (npm:express, pypi:requests) via PkgSeer; global public-code search via Sourcegraph (keyless). Supports qualifiers like kind:, category:, lang:. e.g. code_search(query='handleAuth', target='npm:express')
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | Programming language filter | |
| limit | No | Max results (1-100) | |
| query | Yes | Search query supporting implicit AND, OR, parens, -exclude, and qualifiers (kind:, lang:, path:) | |
| source | No | Restrict results to a specific source type | |
| target | No | Package scope: registry:name[@version] (npm:express, pypi:requests, crates:serde). PkgSeer indexes npm/pypi/crates only. Omit target for global public-repo search via Sourcegraph (keyless). For single GitHub repos use `searchcode` (repository=URL) or `analyze`. |