code_method
Fetch complete source of methods, constructors, properties, or local functions with real line numbers to inspect implementations and edit specific lines directly. Supports batch retrieval of multiple members.
Instructions
PREFERRED METHOD: Fetches the complete source of method(s) (also constructors, properties, module-level functions, the local functions of a TypeScript or JavaScript function such as a React component's handlers, and other members) with line numbers. Returns: kind, class or declaring function, namespace, line range, return type, modifiers, doc summary (XML comment, docstring or JSDoc) and the full body including attributes or decorators. A member too large for one answer (a big React component) comes back as a map instead: its local members with line ranges and its opening lines; fetch the parts you need by name. BATCH MODE: pass 'Method1,Method2,Method3' (comma-separated, NO SPACES) to fetch several members in one call. Overloads of the same name are all returned. Use AFTER code_outline to drill into specific members; to find a member whose file you do not know use code_search first. For a whole small file or a non-code file use code_read. CRITICAL: the line numbers are the real file lines, so they can be used directly with file_edit_lines.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"workspace": "<workspace>",
"relativeFilePath": "<relativeFilePath>",
"methodName": "<methodName>"
},
"name": "code_method"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| guide | No | true: put the code guide first in the result. Use on your first code call, or when told it changed. | |
| className | No | Optional: class name when the file has several classes with the same member name; in TypeScript and JavaScript also the name of the function (component, hook) that declares a local member | |
| workspace | Yes | Workspace name as shown in Waymark (a single workspace; '*' is not accepted) | |
| methodName | Yes | Member name(s) to fetch. Single: 'GetUsers' | Batch: 'GetUsers,UpdateUser,DeleteUser' (NO SPACES) | |
| relativeFilePath | Yes | Path of the source file relative to the workspace root (e.g. 'Services/UserService.cs', 'app/services/user.py' or 'src/components/TradeTable.tsx') |