Capability catalogue
coderead
code.get_file
Read a file from a repository
Text content of one file. Large files are cut at the connection's max_file_bytes (truncated=true).
Effect
read Fanout
no
Cache TTL
none
Traits
none
Implemented by
GitHub, Azure DevOps
The tenant picks one of these when they bind this capability at install time. New implementations land as connectors ship — browse the connector catalogue.
Request arguments
Passed as the args parameter to ctx.capability.call("code.get_file", …).
| Field | Type | Required | Description |
|---|---|---|---|
| ref | string | no | Branch, tag or commit; default: the default branch |
| path | string | yes | |
| repo | string | no |
Response
Returned by ctx.capability.call("code.get_file", …).
| Field | Type | Required | Description |
|---|---|---|---|
| ref | string | null | no | |
| url | string | null | no | |
| path | string | yes | |
| repo | string | no | |
| size | integer | no | |
| binary | boolean | no | |
| content | string | null | no | UTF-8 text; null for binary files |
| truncated | boolean | no |
Example call
From inside your agent's handle(). The kernel resolves code.get_file to the tenant's connector binding at invocation time.
response = await ctx.capability.call(
"code.get_file",
args={
"ref": "...",
"path": "...",
"repo": "...",
},
)See SDK quickstart for the full agent handler template; code examples covers invocation patterns including fanout and error handling.