semantic_search
Search project code with natural language to locate relevant snippets and their file paths, optionally restricted to specific directories.
Instructions
[ARTIFACT TOOLS] Semantic search over artifact chunks, optionally scoped to one or more directories; returns each hit's location plus file content. Read-only.
Parameters: project : project name. query : natural-language search text. limit : max hits. With scopes, applies to the combined OR result, not per scope. scopes : project-relative directory paths, max 20, OR semantics. Omit (or None/[]) for unscoped -- unchanged from before this param existed. Directories only; a file path simply matches nothing.
Returns: on a normal or unscoped call, a list of hits (path, section,
start_line, end_line, distance, content, warning -- as before). If
scopes matched zero chunks, returns a single object instead of a list:
{"message": str} explaining why -- check for a "message" key, not list
length, to tell the two shapes apart.
Raises: 404 unknown project. Validation error for a bad scope (absolute,
'..', outside project root) or >20 scopes -- names the scope, never a
host path. Per-hit read failures set warning (partial success), not an exception.
Do NOT use to read a known file -- call read_project_artifacts instead. Do NOT pass a file path as a scope -- scopes are directories.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max results | |
| query | Yes | Search text | |
| scopes | No | Directory paths to restrict hits to (OR'd, max 20). Omit for unscoped (default). Files won't match -- use read_project_artifacts for a known file. | |
| project | Yes | Project name |