Skip to content

Commit 96442c1

Browse files
list_crate_items
1 parent e98ed75 commit 96442c1

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,44 @@ This server implements the Model Context Protocol (MCP) which allows it to be ea
150150
## License
151151

152152
MIT License
153+
154+
## MCP Tool: `list_crate_items`
155+
156+
The `list_crate_items` tool enumerates all items in a specified Rust crate and version, optionally filtering by item type, visibility, or module path. This is useful for quickly exploring the structure of a crate, generating concise listings for LLMs, or programmatically analyzing crate APIs.
157+
158+
### Usage
159+
160+
```sh
161+
cargo run --bin cratedocs -- list-crate-items --crate-name serde --version 1.0.0
162+
```
163+
164+
#### With filters:
165+
166+
- Filter by item type (e.g., struct, enum, trait, fn, macro, mod):
167+
168+
```sh
169+
cargo run --bin cratedocs -- list-crate-items --crate-name serde --version 1.0.0 --item-type struct
170+
```
171+
172+
- Filter by visibility (e.g., pub, private):
173+
174+
```sh
175+
cargo run --bin cratedocs -- list-crate-items --crate-name serde --version 1.0.0 --visibility pub
176+
```
177+
178+
- Filter by module path:
179+
180+
```sh
181+
cargo run --bin cratedocs -- list-crate-items --crate-name serde --version 1.0.0 --module serde::de
182+
```
183+
184+
### Output
185+
186+
The output is a concise, categorized list (JSON or markdown) showing each item's name, type, visibility, and module path.
187+
188+
**Example (stub output):**
189+
```
190+
Stub: list_crate_items for crate: serde, version: 1.0.0, filters: Some(ItemListFilters { item_type: Some("struct"), visibility: None, module: None })
191+
```
192+
193+
When implemented, the output will be a structured list of items matching the filters.

0 commit comments

Comments
 (0)