Skip to content

API Reference parrot.tools.repo.models

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.tools.repo.models

View source

Shared Pydantic contracts for the read-only repo toolkit (FEAT-484).

These models are the data contracts every tool in parrot.tools.repo returns or raises. They are deliberately free of any dependency beyond pydantic so this module can be imported without pulling in the AbstractToolkit machinery.

Class RepoReadResult

The result of a read_file call.

Fields:

Field Type Default Description
path str The repo-relative path that was read.
content str The file content (possibly truncated).
truncated bool False True when the content was truncated at the byte bound.
total_bytes int 0 The total size of the file, in bytes, before truncation.

Class RepoSearchHit

One ranked result from search_code / related_code.

Fields:

Field Type Default Description
page_id str The wiki plane page id for this hit.
path str The repo-relative path of the source file.
summary str '' A short summary of the page's content.
outline list[str] API outline lines, when the page has one.
score float 0.0 The ranking score assigned to this hit.
approx_tokens int 0 An approximate token count for this hit's payload.

Class RepoSearchResult

The envelope returned by search_code / related_code.

Fields:

Field Type Default Description
query str The original query string.
hits list[RepoSearchHit] The ranked list of search hits.
degraded bool False True when this result was served by the grep_files fallback rather than the graph-backed search.
degraded_reason str '' A human-readable explanation of why the result was degraded, when degraded is True.
total_tokens int 0 The approximate total token count of the payload, bounded by the caller's token budget.

Class RepoToolError

Structured, model-readable rejection. NEVER raised as an exception.

Fields:

Field Type Default Description
error str A short machine-readable error code, e.g. "path_outside_root", "secret_file", "not_found", "timeout".
detail str A human-readable explanation of the error.
path str '' The repo-relative path that triggered the error, if any.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally