Skip to main content
skill CX Codex

lsp-docs — Claude Code skill: symbol lookup and installation

This skill looks up symbol details through LSP, local toolchain docs, then source code. Use it when hover has little to show or a dependency is not indexed.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add blackwell-systems/agent-lsp --skill lsp-docs -a claude-code
Open on GitHub

What lsp-docs does

The lookup follows three steps. First, the skill asks LSP for hover details; next, it checks documentation from the local toolchain; if that fails, it locates the definition and returns its source. Provide a fully qualified symbol and language_id for the documentation lookup. An optional file_path can help resolve Go packages. The skill is read-only and does not edit project files.

The agent-lsp MCP server is required. The second step uses local tools such as go doc, pydoc, or cargo doc. When that route fails, the skill falls back to the source definition. That last result is raw code, not rendered documentation, so you may need to read the implementation directly.

What it helps with

  • look up a symbol when LSP hover returns no useful details
  • retrieve docs for a transitive dependency
  • check a symbol's signature in the local toolchain documentation
  • inspect a definition when documentation lookup fails

Example prompts for the agent

  • Look up fmt.Println in this Go project and explain its documentation.
  • Find details for os.path.join when hover returns nothing.
  • Show the source definition of std::vec::Vec::new.

How to install lsp-docs

1Skills CLI (Vercel)

npx skills add blackwell-systems/agent-lsp --skill lsp-docs -a claude-code

2Manually: put the files in place

~/.claude/skills/lsp-docs/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/lsp-docs/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about lsp-docs

How do I install lsp-docs in Claude Code?

Run npx skills add blackwell-systems/agent-lsp --skill lsp-docs -a claude-code. The skill file is at ~/.claude/skills/lsp-docs/SKILL.md.

What does lsp-docs do?

It looks up symbol details using LSP hover, local toolchain documentation, and finally the source definition. Each step is a fallback if the preceding lookup does not return useful information.

What does lsp-docs need to work?

It requires the agent-lsp MCP server. The documentation step uses a local toolchain, such as go doc, pydoc, or cargo doc.

Source text

SKILL.md · MIT
---
name: lsp-docs
description: Three-tier documentation lookup for any symbol — hover → offline toolchain doc → source definition. Use when hover text is absent, insufficient, or the symbol is in an unindexed dependency.
argument-hint: "[symbol-name]"
user-invocable: true
allowed-tools: mcp__lsp__inspect_symbol mcp__lsp__get_symbol_documentation mcp__lsp__go_to_definition mcp__lsp__get_symbol_source
license: MIT
compatibility: Requires the agent-lsp MCP server (github.com/blackwell-systems/agent-lsp)
metadata:
  required-capabilities: hoverProvider
  optional-capabilities: definitionProvider
---

> Requires the agent-lsp MCP server.

# lsp-docs

Three-tier documentation lookup for any symbol. Works when the language server
is unavailable, when hover returns empty results, or when the symbol lives in a
transitive dependency that gopls or pyright does not index.

Read-only — does not modify any files.

**Invocation:** User provides `symbol_name` in fully-qualified form (e.g.
`"fmt.Println"`, `"std::vec::Vec::new"`, `"os.path.join"`). Optionally provide
`file_path` for any file in the same module, which improves Go package resolution.

---

## Decision table

| Situation | Recommended tier |
|-----------|-----------------|
| Symbol in current workspace | Tier 1 (hover) |
| Symbol in direct dependency | Tier 2 (toolchain doc) |
| Symbol in transitive dep (not indexed by LSP) | Tier 2 |
| No LSP server available | Tier 2 → Tier 3 |
| No toolchain installed (e.g., Rust without cargo) | Tier 3 |

---

## Tier 1 — LSP hover (fast, live, position-based)

Call `inspect_symbol` with the file path and cursor position (1-based).

```
mcp__lsp__inspect_symbol({
  "file_path": "/abs/path/to/file.go",
  "line": 42,
  "column": 8
})
```

If the result contains a non-empty `contents` field with useful type and doc
information, **stop here and return it**. Hover is the fastest path and should
always be tried first.

If hover returns empty `contents`, or the language server is not initialized,
proceed to Tier 2.

---

## Tier 2 — Offline toolchain documentation (authoritative, name-based)

Call `get_symbol_documentation` with the fully-qualified symbol name and
`language_id`. This fetches documentation from the local toolchain (go doc,
pydoc, cargo doc) without requiring an LSP session. Works for transitive
dependencies that the language server does not index.

```
mcp__lsp__get_symbol_documentation({
  "symbol": "fmt.Println",
  "language_id": "go",
  "file_path": "/abs/path/to/any/file/in/the/module.go",  // optional, improves Go pkg resolution
  "format": "markdown"   // optional: wraps signature in code fence
})
```

**Interpreting the result:**

- If `source == "toolchain"`: return the `doc` and `signature` fields to the
  user. These are authoritative — sourced directly from the installed toolchain,
  ANSI-stripped, and ready for display.
- If `source == "error"`: note the `error` field (toolchain failure reason) and
  proceed to Tier 3.

---

## Tier 3 — Source definition (last resort)

Call `go_to_definition` to navigate to the symbol definition, then call
`get_symbol_source` to extract the source text. This always works when the
symbol exists in the workspace or module cache, even without a language server.

```
mcp__lsp__go_to_definition({
  "file_path": "/abs/path/to/caller.go",
  "line": 42,
  "column": 8
})
// → returns definition location

mcp__lsp__get_symbol_source({
  "file_path": "<definition file from above>",
  "line": <definition line from above>
})
// → returns full function/type source text
```

Present the source text to the user with a note that it is raw source, not
rendered documentation.

---

## lsp-impact integration note

Before running `lsp-impact` on an unfamiliar symbol, call
`get_symbol_documentation` to understand its signature and semantics. This
prevents misinterpreting the impact report due to incorrect assumptions about
what the symbol does.

---

## Example

```
Goal: look up documentation for http.ListenAndServe in a Go project

Tier 1 — inspect_symbol: cursor on "ListenAndServe" in main.go:14:6
  → contents: "" (empty — server not initialized)
  Proceed to Tier 2.

Tier 2 — get_symbol_documentation:
  symbol: "net/http.ListenAndServe"
  language_id: "go"
  file_path: "/Users/you/code/myapp/main.go"
  format: "markdown"

  Result:
  {
    "symbol": "net/http.ListenAndServe",
    "language": "go",
    "source": "toolchain",
    "doc": "func ListenAndServe(addr string, handler http.Handler) error\n\nListenAndServe listens on the TCP network address addr and then calls Serve...",
    "signature": "func ListenAndServe(addr string, handler http.Handler) error",
    "error": ""
  }

  source == "toolchain" → return doc and signature to user. Done.

Tier 3 — skipped (Tier 2 succeeded)
```

© blackwell-systems · MIT · blackwell-systems/agent-lsp

Similar skills

All skills for Writing and docs →

From the same set25

lsp-extract-function Extracts selected code blocks into named functions via LSP code actions or manual AST fallback. Validates scopes, arguments, and compilation diagnostics. CX Codex +1 ★ 165repo stars lsp-explore Inspect a symbol’s definition, type details, implementations, callers, and references in one report. Useful when you’re finding your way around an unfamiliar codebase. CX Codex +1 ★ 165repo stars lsp-edit-symbol Changes a function, type or variable by name when you don't know the file or position. Runs on the agent-lsp MCP server. CX Codex +1 ★ 165repo stars lsp-edit-export A guided workflow for editing exported symbols and public APIs. It finds every caller via LSP, pauses for explicit confirmation, and verifies the build. CX Codex +1 ★ 165repo stars lsp-dead-code The skill lists exported symbols in a file and checks each one for references across the workspace. Useful when you want to know which exports are safe to drop. CX Codex +1 ★ 165repo stars lsp-cross-repo Locates callers of a library symbol across consumer repositories via LSP. Useful when preparing to refactor or remove shared code without breaking dependents. CX Codex +1 ★ 165repo stars lsp-concurrency-audit This skill checks how a type’s or file’s fields are accessed across concurrent contexts and produces a safety report. Use it before refactoring or when investigating possible data races. CX Codex +1 ★ 165repo stars lsp-architecture Produces a structural overview of a repository: languages, packages, entry points, dependency flow and hotspot files. One call instead of a manual sweep. CX Codex +1 ★ 165repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor