Skip to content
Konstera
Capability catalogue
codereadfanout

code.search

Search code

Find files whose content matches a query. Fans out across bindings.

Effect
read
Fanout
yes
Cache TTL
none
Traits
none
Implemented by

GitHub

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.search", …).

FieldTypeRequiredDescription
repostringnoOptional repository; default: the connection's default or allowed repositories
limitintegerno
default: 20 · min: 1 · max: 100
querystringyes

Response

Returned by ctx.capability.call("code.search", …).

Array; each element is an object with the following fields.

FieldTypeRequiredDescription
urlstringno
pathstringyes
repostringyes
snippetstring | nullno

Example call

From inside your agent's handle(). The kernel resolves code.search to the tenant's connector binding at invocation time.

response = await ctx.capability.call(
    "code.search",
    args={
        "repo": "...",
        "limit": 20,
        "query": "...",
    },
)

See SDK quickstart for the full agent handler template; code examples covers invocation patterns including fanout and error handling.