# LSP inspection **Added in:** `@mastra/core@1.1.0` LSP inspection gives workspace-backed agents semantic code intelligence. When you enable LSP on a workspace, agents can inspect symbols in supported files to retrieve hover information, jump to definitions, and find implementations. ## When to use LSP inspection Use LSP inspection when your agent needs semantic code understanding instead of plain-text search alone: - Inspect TypeScript or JavaScript symbols and their inferred types - Find where a symbol is declared before editing related code - Explore implementations across a codebase without manually tracing every file - Combine semantic inspection with `view` and `search_content` for faster navigation ## Basic usage Enable LSP on a workspace by setting `lsp: true`: ```typescript import { Workspace, LocalFilesystem, LocalSandbox } from '@mastra/core/workspace' const workspace = new Workspace({ filesystem: new LocalFilesystem({ basePath: './workspace' }), sandbox: new LocalSandbox({ workingDirectory: './workspace' }), lsp: true, }) ``` With this configuration, the workspace registers the default LSP inspection tool alongside the configured filesystem and sandbox tools. ## Agent tool When LSP is enabled, the workspace exposes `mastra_workspace_lsp_inspect` by default. ```json { "path": "/absolute/path/to/file.ts", "line": 10, "match": "const foo = <<