Search Code

Searches for code across repositories

Usage #

// Import the typed helper
import { searchCode } from "@hotglue/sdk/github";
const result = await client.execute({
...searchCode({
q: string,
sort: string,
order: string,
// ...
}),
userId: "user_123",
});
// result is typed as SearchCodeOutput
const result = await client.execute({
integration: "github",
tool: "search_code",
userId: "user_123",
input: {
q: string,
sort: string,
order: string,
// ...
},
});
// The agent will automatically use this tool when needed
const agent = new Agent({
tools: () => hotglueTools({
integrations: ["github"],
userId: "user_123",
}),
});
await agent.generate("run the Search Code tool");

Required Permissions #

repo

Input Schema #

q string required

Search query (must include at least one search term)

sort string

Sort by indexed date

values: indexed
order string
default: desc values: asc, desc
per_page int
default: 30
page int
default: 1

This tool calls: #

GET https://api.github.com/search/code