get_workspace
Retrieve the absolute path of the current VS Code workspace to identify the active project directory.
Instructions
Get current workspace path
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_workspace"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/services/WorkspaceService.ts:63-70 (handler)The actual handler function that executes the 'get_workspace' tool logic. It returns a ToolResult with the current workspace path.
async getWorkspace(): Promise<ToolResult> { return { content: [{ type: 'text', text: `Current workspace: ${this.workspacePath}`, }], }; } - src/toolDefinitions.ts:8-15 (schema)The tool definition/schema for 'get_workspace', including its name, description, and empty inputSchema (no parameters required).
{ name: 'get_workspace', description: 'Get current workspace path', inputSchema: { type: 'object', properties: {}, }, }, - src/index.ts:130-133 (registration)The registration point where the 'get_workspace' tool name is matched in the executeToolCommand switch statement and delegated to workspaceService.getWorkspace().
switch (name) { // Workspace Management case 'get_workspace': return await this.workspaceService.getWorkspace();