|
| 1 | +--- |
| 2 | +id: tools |
| 3 | +title: Available Tools |
| 4 | +--- |
| 5 | + |
| 6 | +The TanStack MCP Server exposes three tools for accessing documentation. Each tool is designed for a specific use case. |
| 7 | + |
| 8 | +## list_libraries |
| 9 | + |
| 10 | +List all available TanStack libraries with their metadata. |
| 11 | + |
| 12 | +### Parameters |
| 13 | + |
| 14 | +| Parameter | Type | Required | Description | |
| 15 | +| --------- | ------ | -------- | ------------------------------------------------------------------- | |
| 16 | +| `group` | string | No | Filter by group: `state`, `headlessUI`, `performance`, or `tooling` | |
| 17 | + |
| 18 | +### Response |
| 19 | + |
| 20 | +Returns an object containing: |
| 21 | + |
| 22 | +- `group` - The group name or "All Libraries" |
| 23 | +- `count` - Number of libraries returned |
| 24 | +- `libraries` - Array of library objects with `id`, `name`, `tagline`, `description`, `frameworks`, `latestVersion`, `docsUrl`, and `githubUrl` |
| 25 | + |
| 26 | +### Example |
| 27 | + |
| 28 | +```json |
| 29 | +{ |
| 30 | + "name": "list_libraries", |
| 31 | + "arguments": { |
| 32 | + "group": "state" |
| 33 | + } |
| 34 | +} |
| 35 | +``` |
| 36 | + |
| 37 | +--- |
| 38 | + |
| 39 | +## get_doc |
| 40 | + |
| 41 | +Fetch a specific documentation page by library and path. |
| 42 | + |
| 43 | +### Parameters |
| 44 | + |
| 45 | +| Parameter | Type | Required | Description | |
| 46 | +| --------- | ------ | -------- | --------------------------------------------------------------------------------------- | |
| 47 | +| `library` | string | Yes | Library ID (e.g., `query`, `router`, `table`, `form`) | |
| 48 | +| `path` | string | Yes | Documentation path (e.g., `framework/react/overview`, `framework/react/guides/queries`) | |
| 49 | +| `version` | string | No | Version (e.g., `v5`, `v1`). Defaults to `latest` | |
| 50 | + |
| 51 | +### Response |
| 52 | + |
| 53 | +Returns an object containing: |
| 54 | + |
| 55 | +- `title` - Document title from frontmatter |
| 56 | +- `content` - Full markdown content of the document |
| 57 | +- `url` - Canonical URL to the documentation page |
| 58 | +- `library` - Library name |
| 59 | +- `version` - Resolved version |
| 60 | + |
| 61 | +### Example |
| 62 | + |
| 63 | +```json |
| 64 | +{ |
| 65 | + "name": "get_doc", |
| 66 | + "arguments": { |
| 67 | + "library": "query", |
| 68 | + "path": "framework/react/guides/queries", |
| 69 | + "version": "v5" |
| 70 | + } |
| 71 | +} |
| 72 | +``` |
| 73 | + |
| 74 | +### Common Documentation Paths |
| 75 | + |
| 76 | +Most TanStack libraries follow this path structure: |
| 77 | + |
| 78 | +- `framework/{framework}/overview` - Framework-specific overview |
| 79 | +- `framework/{framework}/installation` - Installation guide |
| 80 | +- `framework/{framework}/guides/{topic}` - Guides for specific topics |
| 81 | +- `framework/{framework}/reference/{api}` - API reference |
| 82 | + |
| 83 | +Where `{framework}` is one of: `react`, `vue`, `solid`, `svelte`, `angular` |
| 84 | + |
| 85 | +--- |
| 86 | + |
| 87 | +## search_docs |
| 88 | + |
| 89 | +Full-text search across all TanStack documentation. |
| 90 | + |
| 91 | +### Parameters |
| 92 | + |
| 93 | +| Parameter | Type | Required | Description | |
| 94 | +| ----------- | ------ | -------- | ------------------------------------------------------------ | |
| 95 | +| `query` | string | Yes | Search query | |
| 96 | +| `library` | string | No | Filter to specific library (e.g., `query`, `router`) | |
| 97 | +| `framework` | string | No | Filter to specific framework (e.g., `react`, `vue`, `solid`) | |
| 98 | +| `limit` | number | No | Maximum results (default: 10, max: 50) | |
| 99 | + |
| 100 | +### Response |
| 101 | + |
| 102 | +Returns an object containing: |
| 103 | + |
| 104 | +- `query` - The search query |
| 105 | +- `totalHits` - Total number of matching documents |
| 106 | +- `results` - Array of search results with `title`, `url`, `snippet`, `library`, and `breadcrumb` |
| 107 | + |
| 108 | +### Example |
| 109 | + |
| 110 | +```json |
| 111 | +{ |
| 112 | + "name": "search_docs", |
| 113 | + "arguments": { |
| 114 | + "query": "useQuery refetch", |
| 115 | + "library": "query", |
| 116 | + "framework": "react", |
| 117 | + "limit": 5 |
| 118 | + } |
| 119 | +} |
| 120 | +``` |
| 121 | + |
| 122 | +--- |
| 123 | + |
| 124 | +## Usage Tips |
| 125 | + |
| 126 | +### Finding Documentation |
| 127 | + |
| 128 | +1. **Start with `list_libraries`** to discover available libraries and their IDs |
| 129 | +2. **Use `search_docs`** to find specific topics when you don't know the exact path |
| 130 | +3. **Use `get_doc`** to fetch the full content once you know the path |
| 131 | + |
| 132 | +### Version Handling |
| 133 | + |
| 134 | +- Use `latest` (default) to always get the current documentation |
| 135 | +- Specify a version like `v5` or `v4` when working with a specific library version |
| 136 | +- The `list_libraries` tool shows available versions for each library |
| 137 | + |
| 138 | +### Path Discovery |
| 139 | + |
| 140 | +Search results include URLs that reveal the documentation path structure. For example, a URL like `https://tanstack.com/query/latest/docs/framework/react/guides/queries` indicates: |
| 141 | + |
| 142 | +- Library: `query` |
| 143 | +- Path: `framework/react/guides/queries` |
0 commit comments