Use this tool to search and analyze code structure in the codebase knowledge graph. It provides code snippets with AST type, language, name, and file location.

**search** — Find code by query:
- operation="search"
- query: Search query string
- maxResults: Max results to return (default: 10)
- astType: Filter by AST type (e.g., class_declaration, function_declaration)
- language: Filter by language (e.g., ts, py, rs)
- minScore: Min score threshold (default: 0.3)

**queryEdges** — Explore code relationships:
- operation="queryEdges"
- nodeId: Node ID to query relations (required)
- direction: Edge direction - "in", "out", or "both" (default: "both")
- maxDepth: Max depth of relations (default: 2)

## Usage Examples

```
# Search for Session class
codebase(operation="search" query="Session" astType="class_declaration")

# Search Python functions
codebase(operation="search" query="handler" language="py")

# Query node relationships
codebase(operation="queryEdges" nodeId="ts:/path/file.ts:class:Session")
```

## Filter Values

**astType** — Code element types:
`class_declaration`, `class_definition`, `function_declaration`, `function_definition`, `method_definition`, `method_declaration`, `interface_declaration`, `type_alias_declaration`, `enum_declaration`, `variable_declaration`, `import_declaration`, `import_statement`, `struct_declaration`, `struct_specifier`

**language** — Programming languages:
`ts`, `tsx`, `js`, `jsx`, `py`, `rs`, `go`, `c`, `cpp`, `csharp`, `java`, `scala`, `ruby`, `php`, `zig`

**direction**: in (incoming), out (outgoing), both
