Skip to content

ollama_code_map

Code map (deterministic). ORIENT. Fast structural summary of a repo — deterministic, no model call. Pass source_paths: string[] (files OR directories; directories are walked recursively, skipping node_modules/dist/target/.git/.venv) and optional max_files (default 500). Reads package.json / pyproject.toml / Cargo.toml / go.mod for framework hints; tallies files by extension; classifies entrypoints (cli/lib/web/test/config) by filename + manifest bin field; collects build_commands from package.json scripts. Returns {languages, frameworks, entrypoints, build_commands, notable_files, total_files_scanned, max_files_hit}. Cheap first pass before ollama_repo_pack or ollama_research. When the pass is partial (max_files_hit), the warning says so.

Parameter Type Required Default Description
source_paths string[] yes Absolute or relative paths to scan (files or directories). Directories are walked recursively.
max_files integer no Cap on total files scanned. Default 500 — raise for large repos, but this is a FAST pass, not an exhaustive crawl.

The JSON Schema below is generated from the same zod schema the server validates against at the wire — it cannot drift from runtime behavior.

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"source_paths": {
"minItems": 1,
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"description": "Absolute or relative paths to scan (files or directories). Directories are walked recursively."
},
"max_files": {
"description": "Cap on total files scanned. Default 500 — raise for large repos, but this is a FAST pass, not an exhaustive crawl.",
"type": "integer",
"minimum": 1,
"maximum": 10000
}
},
"required": [
"source_paths"
]
}

Every tool returns the standard envelope — tier_used, model, tokens_in/tokens_out, elapsed_ms, backend provenance, warnings. See Envelope & tiers.

Schema + handler: src/tools/codeMap.ts · registration: src/index.ts


Back to the Tool Reference.