Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Tools Reference

All tools are available when bobbin runs as an MCP server (bobbin serve). Each tool accepts JSON parameters and returns JSON results.

Search for code using natural language. Finds functions, classes, and other code elements that match the semantic meaning of your query.

Parameters:

ParameterTypeRequiredDefaultDescription
querystringyes—Natural language search query
typestringnoallFilter by chunk type: function, method, class, struct, enum, interface, module, impl, trait
limitintegerno10Maximum number of results
modestringnohybridSearch mode: hybrid, semantic, or keyword
repostringnoallFilter to a specific repository

Response fields: query, mode, count, results[] (each with id, file_path, name, chunk_type, start_line, end_line, score, match_type, language, content_preview)

The id field is the chunk’s stable identifier — pass it to chunk_neighbors to follow relationship edges from a result.

grep

Search for code using exact keywords or regex patterns.

Parameters:

ParameterTypeRequiredDefaultDescription
patternstringyes—Pattern to search for
ignore_casebooleannofalseCase-insensitive search
regexbooleannofalseEnable regex matching (post-filters FTS results)
typestringnoallFilter by chunk type
limitintegerno10Maximum number of results
repostringnoallFilter to a specific repository

Response fields: pattern, count, results[] (each with file_path, name, chunk_type, start_line, end_line, score, language, content_preview, matching_lines[])

context

Assemble a comprehensive context bundle for a task. Combines semantic search results with temporally coupled files from git history.

Parameters:

ParameterTypeRequiredDefaultDescription
querystringyes—Natural language task description
budgetintegerno500Maximum lines of content
depthintegerno1Coupling expansion depth (0 = no coupling)
max_coupledintegerno3Max coupled files per seed file
limitintegerno20Max initial search results
coupling_thresholdfloatno0.1Minimum coupling score
repostringnoallFilter to a specific repository

Response fields: query, budget (max_lines, used_lines), files[] (each with path, language, relevance, score, coupled_to[], chunks[]), summary (total_files, total_chunks, direct_hits, coupled_additions)

Find files related to a given file based on git commit history (temporal coupling).

Parameters:

ParameterTypeRequiredDefaultDescription
filestringyes—File path relative to repo root
limitintegerno10Maximum number of results
thresholdfloatno0.0Minimum coupling score (0.0–1.0)

Response fields: file, related[] (each with path, score, co_changes)

test_coverage

Map test↔source coverage inferred from git co-change history. Given a source file, returns the test files that change with it (the tests that likely cover it); given a test file, returns the source files it covers. Test files are detected by path conventions (test_*, *_test.*, *_spec.*, tests/, etc.).

Parameters:

ParameterTypeRequiredDefaultDescription
filestringyes—File path relative to repo root
limitintegerno10Maximum number of results
thresholdfloatno0.0Minimum coupling score (0.0–1.0)

Response fields: file, link_kind ("test" when file is source, "source" when file is a test), links[] (each with path, score, co_changes)

find_refs

Find the definition and all usages of a symbol by name.

Parameters:

ParameterTypeRequiredDefaultDescription
symbolstringyes—Exact symbol name (e.g., parse_config)
typestringnoallFilter by symbol type
limitintegerno20Maximum number of usage results
repostringnoallFilter to a specific repository

Response fields: symbol, definition (name, chunk_type, file_path, start_line, end_line, signature), usage_count, usages[] (each with file_path, line, context)

list_symbols

List all symbols (functions, structs, traits, etc.) defined in a file.

Parameters:

ParameterTypeRequiredDefaultDescription
filestringyes—File path relative to repo root
repostringnoallFilter to a specific repository

Response fields: file, count, symbols[] (each with name, chunk_type, start_line, end_line, signature)

chunk_neighbors

Follow relationship edges from a chunk. Deterministic structural edges (next_chunk, part_of) are emitted for every indexed file; AST edges (implements, impl_for, extends) come from tree-sitter; similar_to edges are near-duplicate pairs persisted opt-in by bobbin similar --scan --persist.

Parameters:

ParameterTypeRequiredDefaultDescription
idstringno*—Chunk ID from search results (preferred anchor)
filestringno*—File path relative to repo root, used with line
lineintegerno*—Line within file; smallest containing chunk becomes the anchor
repostringnoallDisambiguates file in multi-repo stores
edge_typestringnoallFilter: next_chunk, part_of, implements, impl_for, extends, tests, similar_to
directionstringnobothout (anchor is edge source), in (anchor is target)
limitintegerno20Maximum neighbors returned

*Provide either id, or both file and line.

Direction semantics: for next_chunk, out is the following chunk and in the preceding one; for part_of, out is the containing parent and in lists children.

Response fields: chunk (resolved anchor: id, file_path, name, chunk_type, start_line, end_line), count, neighbors[] (each with edge_type, direction, the same chunk fields, content_preview), dangling[] (edge endpoints whose chunk ID no longer resolves — present only after edits shifted line ranges; re-index the file to refresh)

read_chunk

Read a specific section of code from a file by line range.

Parameters:

ParameterTypeRequiredDefaultDescription
filestringyes—File path relative to repo root
start_lineintegeryes—Starting line number
end_lineintegeryes—Ending line number
contextintegerno0Context lines to include before and after

Response fields: file, start_line, end_line, actual_start_line, actual_end_line, content, language

hotspots

Identify code hotspots — files with both high churn and high complexity.

Parameters:

ParameterTypeRequiredDefaultDescription
sincestringno1 year agoTime window (e.g., 6 months ago, 3 months ago)
limitintegerno20Maximum number of hotspots
thresholdfloatno0.0Minimum hotspot score (0.0–1.0)

Response fields: count, since, hotspots[] (each with file, score, churn, complexity, language)

prime

Get an LLM-friendly overview of the bobbin project with live index statistics.

Parameters:

ParameterTypeRequiredDefaultDescription
sectionstringnoallSpecific section: what bobbin does, architecture, supported languages, key commands, mcp tools, quick start, configuration
briefbooleannofalseCompact overview (title and first section only)

Response fields: primer (markdown text), section, initialized, stats (total_files, total_chunks, total_embeddings, languages[], last_indexed)

impact

Predict which files are affected by a change to a target file or function. Combines git co-change coupling and semantic similarity signals.

Parameters:

ParameterTypeRequiredDefaultDescription
targetstringyes—File path or file:symbol reference
depthintegerno1Transitive expansion depth (0–3)
modestringnocombinedSignal mode: combined, coupling, semantic, deps
thresholdfloatno0.1Minimum impact score
limitintegerno20Maximum number of results

review

Assemble review context from a git diff. Finds indexed chunks overlapping changed lines and expands via temporal coupling.

Parameters:

ParameterTypeRequiredDefaultDescription
diffstringnounstagedDiff spec: unstaged, staged, branch:<name>, commit:<range>
budgetintegerno500Maximum lines of context
depthintegerno1Coupling expansion depth

similar

Find code chunks semantically similar to a target, or scan for duplicate clusters.

Parameters:

ParameterTypeRequiredDefaultDescription
targetstringno—Chunk reference (file.rs:function_name) or free text
scanbooleannofalseScan entire codebase for near-duplicate clusters
thresholdfloatno0.85Minimum similarity score
limitintegerno10Maximum results
cross_repobooleannofalseInclude cross-repo matches

search_beads

Search for beads (issues/tasks) using natural language. Requires beads to be indexed via bobbin index --include-beads.

Parameters:

ParameterTypeRequiredDefaultDescription
querystringyes—Natural language query
priorityintegernoallFilter by priority (1–4)
statusstringnoallFilter by status
assigneestringnoallFilter by assignee
limitintegerno10Maximum results
enrichbooleannotrueEnrich with live Dolt metadata

dependencies

Show import dependencies for a file. Returns forward and/or reverse dependencies.

Parameters:

ParameterTypeRequiredDefaultDescription
filestringyes—File path relative to repo root
reversebooleannofalseShow reverse dependencies (what imports this file)
bothbooleannofalseShow both forward and reverse
repostringnoallFilter to a specific repository

file_history

Show git commit history for a specific file, with author breakdown and churn rate.

Parameters:

ParameterTypeRequiredDefaultDescription
filestringyes—File path relative to repo root
limitintegerno20Maximum commits to return

status

Show current index status and statistics.

Parameters:

ParameterTypeRequiredDefaultDescription
languagesbooleannofalseInclude per-language breakdown

Search git commit history using natural language.

Parameters:

ParameterTypeRequiredDefaultDescription
querystringyes—Natural language query
authorstringnoallFilter by author
filestringnoallFilter by file path
limitintegerno10Maximum results

feedback_submit

Submit feedback on a bobbin context injection. Rate injections as useful, noise, or harmful.

Parameters:

ParameterTypeRequiredDefaultDescription
injection_idstringyes—Injection ID from [injection_id: inj-xxx]
ratingstringyes—useful, noise, or harmful
agentstringnoautoAgent identity (auto-detected from env)
reasonstringno—Explanation (max 1000 chars)

feedback_list

List recent feedback records with optional filters.

Parameters:

ParameterTypeRequiredDefaultDescription
ratingstringnoallFilter by rating
agentstringnoallFilter by agent
limitintegerno20Maximum results (max 50)

feedback_stats

Get aggregated feedback statistics — total injections, coverage rate, rating breakdown, and lineage counts.

Parameters: None.

feedback_lineage_store

Record a lineage action that ties feedback to a concrete fix. Links feedback records to commits, beads, or config changes.

Parameters:

ParameterTypeRequiredDefaultDescription
feedback_idsinteger[]yes—Feedback record IDs to link
action_typestringyes—code_fix, config_change, tag_effect, access_rule, or exclusion_rule
beadstringno—Associated bead ID
commit_hashstringno—Git commit hash
descriptionstringyes—What was done
agentstringnoautoAgent identity

feedback_lineage_list

List lineage records showing how feedback was acted on.

Parameters:

ParameterTypeRequiredDefaultDescription
feedback_idintegernoallFilter by feedback ID
beadstringnoallFilter by bead ID
commit_hashstringnoallFilter by commit hash
limitintegerno20Maximum results (max 50)

Search archive records (HLA chat logs, Pensieve agent memory) using natural language.

Parameters:

ParameterTypeRequiredDefaultDescription
querystringyes—Natural language query
sourcestringnoallFilter: hla or pensieve
filterstringnoallFilter by name/channel
afterstringno—Only records after date (YYYY-MM-DD)
beforestringno—Only records before date (YYYY-MM-DD)
limitintegerno10Maximum results
modestringnohybridhybrid, semantic, or keyword

archive_recent

List recent archive records by date.

Parameters:

ParameterTypeRequiredDefaultDescription
afterstringyes—Only records after date (YYYY-MM-DD)
sourcestringnoallFilter: hla or pensieve
limitintegerno20Maximum results

knowledge_context

Find entities and facts relevant to a topic across both knowledge graphs a deployment has, using text search with link expansion. The response has two clearly separated sections: ontology (the organization knowledge graph on a remote Quipu — infrastructure, ownership, and operational facts) and local_code_graph (bobbin’s own embedded graph of code entities and file-coupling from git history). Best for questions like “what services run on node-4?” or “which files change together with X?”.

Always read the store field in the result: ontology.consulted = false means the remote was not asked (no remote configured), and an error there is a transport failure — neither is evidence a fact is absent.

Requires bobbin built with the knowledge feature (cargo build --features knowledge). Without it the tool is registered but returns an error directing you to rebuild.

Parameters:

ParameterTypeRequiredDefaultDescription
querystringyes—Natural language query describing the entities you need
max_entitiesintegerno20Maximum entities to return
expand_linksbooleannotrueExpand results by following graph links from direct hits

knowledge_query

Execute a SPARQL SELECT query against both knowledge graphs, with optional temporal filtering. The same query runs against the remote ontology Quipu and bobbin’s embedded code graph, and each returns its rows in a separate section — an IRI that exists in only one graph returns rows in only that section. Best for precise structured queries when you know the entity IRIs or predicates.

As with knowledge_context, read the store field: an empty section is never by itself evidence the fact does not exist.

Requires the knowledge build feature (see knowledge_context).

Parameters:

ParameterTypeRequiredDefaultDescription
querystringyes—SPARQL SELECT query
valid_atstringno—ISO-8601 timestamp for a temporal query (what was true then?)
txintegerno—Transaction ID for a point-in-time (as-of) query

knowledge_knot

Write facts into bobbin’s local embedded knowledge graph as RDF Turtle. This writes only to the local graph — never to the remote ontology Quipu, which is read-only from here.

Always read the shacl_validated field in the result. When true, the write was checked against the configured SHACL shapes before being committed, and a violating write would have been refused (a SHACL refusal surfaces as a tool error, not as a success with a flag). When false, validation was not compiled in and the facts were stored unchecked — a success then means only that the write was accepted, not that it is conformant.

Requires the knowledge build feature (see knowledge_context).

Parameters:

ParameterTypeRequiredDefaultDescription
turtlestringyes—Facts to write, as RDF Turtle
actorstringno—Actor recorded as the author of this write (provenance). Pass it whenever you have one
sourcestringno—Where the facts came from (e.g. a file path or tool name)
shapesstringno—SHACL shapes (Turtle) to validate against instead of the store’s configured shapes

Response fields: written (the store’s write result), shacl_validated, store

knowledge_reconcile_mentions

Run the idempotent chunk→entity mention reconcile pass over bobbin’s local knowledge graph. It resolves weak bobbin:mentions "SymbolName" literals on chunk facts into typed reference edges against the live entity graph, and reports every mention as one of three outcomes: resolved (exactly one match — edge written), dangling (no match — literal left in place for a later run), or ambiguous (multiple matches — left unresolved, never guessed).

Safe to re-run: an unchanged store yields the identical classification with edges_written = 0. Run it after new entities land in the graph to pick up previously dangling mentions. The same pass runs automatically after each chunk-snapshot push during bobbin index (see Quipu Integration).

Requires the knowledge build feature (see knowledge_context).

Parameters:

ParameterTypeRequiredDefaultDescription
max_detailsintegerno50Maximum per-mention detail entries to return. The three counts are always complete

Response fields: resolved, dangling, ambiguous, edges_written, details[], details_truncated, store

knowledge_inferred_extract

Extract candidate entities and relationships from markdown prose via bobbin’s inferred-track extractor seam. The one extractor today is the deterministic backtick-coderef heuristic — not a language model, and honestly labeled as such in every fact it produces.

Everything returned is a claim at quarantined standing, never an observation. The response envelope carries the quarantine plane, trust rank 0, and sourceKind = inferred — inferred facts are never served bare. With push = true the stamped facts also land in the quarantined plane via a graph-routed /knot write, each fact carrying its extractor and parameters as the derivation method; the write refuses if the embedded store cannot enforce graph routing (the facts would masquerade in the default graph at observed standing) or the plane is unregistered. Promotion out of quarantine is the governing ontology’s authority-gated flow, never this tool’s.

Requires the knowledge build feature (see knowledge_context).

Parameters:

ParameterTypeRequiredDefaultDescription
textstringyes—Markdown prose to run the extractor over
repostringnoadhocRepository name the prose belongs to, for IRI minting
file_pathstringnoadhoc.mdFile path the prose came from, for the source-chunk IRI
pushbooleannofalseAlso land the stamped facts in the quarantined plane (default is preview only)

Response fields: extractor (id, params), entities, relations, quarantine (graph, snapshot, turtle), pushed (tx_id, count — only when push = true), all wrapped in the quarantine envelope