Skip to main content

Coding Tools

Category: coding · 12 tools

AST-aware code analysis, symbol navigation, and refactoring for JavaScript/TypeScript.

Symbol Navigation

ToolParametersDescription
coding.find_symbolsymbol, pathFind function/class/variable definitions
coding.get_symbolsfileList all symbols in a file
coding.find_referencessymbol, pathFind all references to a symbol
coding.go_to_definitionfile, line, columnJump to symbol definition

Code Analysis

ToolParametersDescription
coding.get_importsfileList all import statements
coding.get_exportsfileList all exported symbols
coding.get_outlinefileGet hierarchical file outline
coding.get_diagnosticsfileGet syntax errors and warnings
coding.get_call_hierarchyfile, line, columnShow callers and callees

Refactoring

ToolParametersDescription
coding.refactor_renamesymbol, newName, pathRename symbol across codebase
coding.extract_functionfile, startLine, startColumn, endLine, endColumn, newFunctionNameExtract code into new function
coding.multi_file_editeditsEdit multiple files atomically

Examples

Finding Symbols

const stream = toolpack.stream({
messages: [{ role: 'user', content: 'Find where the handleSubmit function is defined' }],
model: 'gpt-4o',
});
// AI uses coding.find_symbol

Code Analysis

const stream = toolpack.stream({
messages: [{ role: 'user', content: 'What does this file export?' }],
model: 'gpt-4o',
});
// AI uses coding.get_exports

Refactoring

const stream = toolpack.stream({
messages: [{ role: 'user', content: 'Rename the User class to UserAccount everywhere' }],
model: 'gpt-4o',
});
// AI uses coding.refactor_rename

Supported Languages

  • JavaScript (.js, .jsx)
  • TypeScript (.ts, .tsx)

The coding tools use Babel for AST parsing, providing accurate symbol resolution and refactoring.