# SalmonTools (@salmonui/mcp)

> The SalmonTools class of @salmonui/mcp: The tools bound to one index; lookup structures are built lazily, once.

Canonical: https://salmonui.dev/docs/reference/mcp/SalmonTools

```ts
import { SalmonTools } from '@salmonui/mcp';
```

Entry index: https://salmonui.dev/docs/reference/mcp (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/mcp.md).

## Reference

Kind: class

```ts
class SalmonTools {
    #private;
    readonly index: McpIndex;
    readonly map: ExportsMap;
    constructor(index: McpIndex);
    call(name: string, args: Readonly<Record<string, unknown>>): ToolResult;
    url(path: string): string;
    get symbolsByName(): Map<string, IndexSymbol[]>;
    listComponents(filter?: string): ToolResult;
    get docsSearch(): {
        bm25: Bm25;
        refs: {
            doc: IndexDoc;
            section: number;
        }[];
    };
    rankDocs(query: string): {
        doc: IndexDoc;
        score: number;
        sections: {
            index: number;
            score: number;
        }[];
    }[];
    searchDocs(query: string, limit: number): ToolResult;
    docsMentioning(name: string, max?: number): IndexDoc[];
    referenceUrl(specifier: string): string;
    stylesheetLines(specifier: string): string[];
    getComponent(rawName: string): ToolResult;
    suggestNames(name: string, max?: number): string[];
    describeFamily(pkg: IndexPackage, family: IndexFamily): string;
    describeSymbol(symbol: IndexSymbol, { header }?: {
        header?: string;
    }): string;
    propsOf(symbol: IndexSymbol): {
        members: IndexMember[];
        from: string;
        alias?: string;
    } | undefined;
    get demoSearch(): Bm25;
    getExample(id?: string, query?: string): ToolResult;
    checkImports(source: string, stylesheets?: boolean): ToolResult;
}
```

The tools bound to one index; lookup structures are built lazily, once.

Members (21):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `__#1@#private` | `#private;` |  |  |
| `index` | `readonly index: McpIndex;` |  |  |
| `map` | `readonly map: ExportsMap;` |  |  |
| `call` | `call(name: string, args: Readonly<Record<string, unknown>>): ToolResult;` |  |  |
| `url` | `url(path: string): string;` |  |  |
| `symbolsByName` | `get symbolsByName(): Map<string, IndexSymbol[]>;` |  |  |
| `listComponents` | `listComponents(filter?: string): ToolResult;` |  |  |
| `docsSearch` | `get docsSearch(): {     bm25: Bm25;     refs: {         doc: IndexDoc;         section: number;     }[]; };` |  |  |
| `rankDocs` | `rankDocs(query: string): {     doc: IndexDoc;     score: number;     sections: {         index: number;         score: number;     }[]; }[];` |  | Pages for a query: per page, the best section scores, best first. |
| `searchDocs` | `searchDocs(query: string, limit: number): ToolResult;` |  |  |
| `docsMentioning` | `docsMentioning(name: string, max?: number): IndexDoc[];` |  | Docs pages that name a symbol in code, most mentions first. |
| `referenceUrl` | `referenceUrl(specifier: string): string;` |  |  |
| `stylesheetLines` | `stylesheetLines(specifier: string): string[];` |  |  |
| `getComponent` | `getComponent(rawName: string): ToolResult;` |  |  |
| `suggestNames` | `suggestNames(name: string, max?: number): string[];` |  |  |
| `describeFamily` | `describeFamily(pkg: IndexPackage, family: IndexFamily): string;` |  |  |
| `describeSymbol` | `describeSymbol(symbol: IndexSymbol, { header }?: {     header?: string; }): string;` |  |  |
| `propsOf` | `propsOf(symbol: IndexSymbol): {     members: IndexMember[];     from: string;     alias?: string; } \| undefined;` |  | The props of a component (its `props` parameter type, else `<Name>Props`), or the members of a type alias. An alias without members of its own (`type ButtonProps = ButtonBaseProps & (...)`, a union of variants) gets the members of the object types it names, merged by name. |
| `demoSearch` | `get demoSearch(): Bm25;` |  |  |
| `getExample` | `getExample(id?: string, query?: string): ToolResult;` |  |  |
| `checkImports` | `checkImports(source: string, stylesheets?: boolean): ToolResult;` |  |  |
