Skip to main content
Glama

add_workspace_folder

Add a directory to the LSP workspace to enable cross-repo references, definitions, and diagnostics. Supports multi-root workspaces for languages like Go, Rust, and TypeScript.

Instructions

Add a directory to the LSP workspace, enabling cross-repo references, definitions, and diagnostics. Useful when working across a library and its consumers — after adding the consumer repo, get_references on a library function returns call sites in both repos. Requires start_lsp to have been called first. Language servers that support multi-root workspaces (gopls, rust-analyzer, typescript-language-server) will re-index the new folder automatically.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and does well: it discloses that this enables cross-repo functionality, mentions automatic re-indexing by specific language servers (gopls, rust-analyzer, typescript-language-server), and states the prerequisite. It doesn't mention error conditions or performance implications, but provides substantial behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three well-structured sentences with zero waste: first states purpose, second provides usage example, third covers prerequisites and server behavior. Every sentence adds value and is front-loaded with key information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description does well: covers purpose, usage context, prerequisites, and behavioral details about server re-indexing. Could mention what happens if the path doesn't exist or isn't a valid directory, but otherwise quite complete given the complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. While it doesn't explicitly mention the 'path' parameter, it implies it through context: 'adding the consumer repo' and 'new folder'. The description adds meaningful context about what the path represents (a directory to add to workspace), though it could be more explicit about parameter expectations.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Add' and resource 'directory to the LSP workspace', with specific functionality: 'enabling cross-repo references, definitions, and diagnostics'. It distinguishes from sibling 'remove_workspace_folder' by being the addition counterpart and from 'list_workspace_folders' by being a mutation tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use: 'Useful when working across a library and its consumers' and provides a concrete example: 'after adding the consumer repo, get_references on a library function returns call sites in both repos'. Also specifies prerequisite: 'Requires start_lsp to have been called first'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/blackwell-systems/agent-lsp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server