source
Raw file/git access at the indexed commit, for cloud agents with no clone; with a clone prefer your own Read/Grep/git. Ops:
read: content of filePath, whole file or slice startLine..endLine. ifHash (a prior read's hash) returns {unchanged:true}, no content. compact:true strips blank/comment-only lines.
list: files+subdirs at path. grep: ripgrep pattern (glob/pathPrefix). tree: layout from path. stat: size/lines/language/binary for filePath. blame: authorship for filePath. diff: fromSha..toSha. Keys: {op:"read",filePath:"src/a.ts"}, {op:"grep",pattern:"foo"}, {op:"list",path:"src"}. filePath is the file, path the directory. Gated by the Source Access add-on; else source_access_required.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | No | See the tool description for each op. Omitted: inferred from the other args (pattern -> grep, fromSha/toSha -> diff, filePath/path -> read, nothing -> list). | |
| glob | No | grep: limit to files matching this glob. | |
| path | No | list/tree/diff: dir path in the repo (default root). On read/stat/blame it is read as filePath, on grep as pathPrefix. | |
| limit | No | grep: max matches. | |
| query | No | grep: alias for pattern. | |
| toSha | No | diff: target commit (required), reachable from the indexed branch. | |
| ifHash | No | read: a prior read's hash; if it still matches, returns {unchanged:true}, no content. | |
| compact | No | read: strip blank/comment-only lines (heuristic; content no longer maps 1:1 to lines). | |
| endLine | No | read/blame: last line, 1-based. | |
| fromSha | No | diff: base commit (required), reachable from the indexed branch. | |
| pattern | No | grep: ripgrep pattern (required; `query` is accepted as an alias). | |
| feedback | No | Optional: report how a previous answer worked out; piggybacks on any call. | |
| filePath | No | read/stat/blame: the file to open (required; `path` is accepted as an alias). | |
| maxDepth | No | tree: max recursion depth, default 3. | |
| commitSha | No | Pin reads to one indexed revision (7-40 hex). Graph tools error with revision_not_indexed when it is not an indexed revision of the scoped repository, or revision_not_servable when that revision's graph was superseded by a later reindex, and echo the revision served back as commitSha; source ops read git objects, so any commit works there. Exception: a kept revision (revisions rows flagged architectureSnapshot) still serves map view:"architecture" as a preserved snapshot. | |
| projectId | No | Project id from init/list_projects. Omit for the active project. | |
| startLine | No | read/blame: first line, 1-based. | |
| pathPrefix | No | grep: limit to files under this prefix. | |
| repository | No | Repository full name, e.g. "owner/repo". Omit when the project has one repository. |