Class: Tool
Defined in: packages/core/src/domain/Tool.ts:31
Represents an MCP Tool — an executable capability exposed to LLMs.
Tools are leaf nodes in the domain model hierarchy. They can belong to one or more Groups and carry input/output schemas plus behavioral annotations for LLM safety hints.
Example
import { Tool, createToolAnnotations } from '@vinkius-core/mcp-fusion';
const tool = new Tool('read_file');
tool.title = 'Read File';
tool.description = 'Read a file from the filesystem';
tool.inputSchema = JSON.stringify({
type: 'object',
properties: { path: { type: 'string' } },
});
tool.toolAnnotations = createToolAnnotations({
readOnlyHint: true,
destructiveHint: false,
});See
- GroupItem for group membership
- ToolAnnotations for behavioral hints
Extends
Constructors
Constructor
new Tool(name): Tool;Defined in: packages/core/src/domain/Tool.ts:39
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
Tool
Overrides
GroupItem.constructorProperties
description
description: string | undefined;Defined in: packages/core/src/domain/BaseModel.ts:33
Detailed description of this entity's purpose
Inherited from
icons
icons: Icon[] | undefined;Defined in: packages/core/src/domain/BaseModel.ts:37
Visual icons associated with this entity
Inherited from
inputSchema
inputSchema: string | undefined;Defined in: packages/core/src/domain/Tool.ts:33
JSON Schema string describing the tool's input parameters
meta
meta: Map<string, unknown> | undefined;Defined in: packages/core/src/domain/BaseModel.ts:35
Arbitrary key-value metadata for extensibility
Inherited from
name
readonly name: string;Defined in: packages/core/src/domain/BaseModel.ts:29
Unique identifier within the parent scope
Inherited from
nameSeparator
readonly nameSeparator: string;Defined in: packages/core/src/domain/BaseModel.ts:27
Separator character for constructing fully qualified names
Inherited from
outputSchema
outputSchema: string | undefined;Defined in: packages/core/src/domain/Tool.ts:35
JSON Schema string describing the tool's output format
parentGroups
readonly parentGroups: Group[];Defined in: packages/core/src/domain/GroupItem.ts:28
Groups that contain this item (many-to-many relationship)
Inherited from
title
title: string | undefined;Defined in: packages/core/src/domain/BaseModel.ts:31
Human-readable display title
Inherited from
toolAnnotations
toolAnnotations: ToolAnnotations | undefined;Defined in: packages/core/src/domain/Tool.ts:37
MCP annotations providing behavioral hints to LLMs
DEFAULT_SEPARATOR
readonly static DEFAULT_SEPARATOR: string = ".";Defined in: packages/core/src/domain/BaseModel.ts:24
Default separator used in fully qualified names
Inherited from
Methods
addParentGroup()
addParentGroup(parentGroup): boolean;Defined in: packages/core/src/domain/GroupItem.ts:41
Add this item to a parent group.
Parameters
| Parameter | Type | Description |
|---|---|---|
parentGroup | Group | The group to join |
Returns
boolean
false if already a member, true if added
Inherited from
getFullyQualifiedName()
getFullyQualifiedName(): string;Defined in: packages/core/src/domain/GroupItem.ts:58
Returns the simple name (leaf items have no hierarchy prefix)
Returns
string
Inherited from
GroupItem.getFullyQualifiedName
removeParentGroup()
removeParentGroup(parentGroup): boolean;Defined in: packages/core/src/domain/GroupItem.ts:53
Remove this item from a parent group.
Parameters
| Parameter | Type | Description |
|---|---|---|
parentGroup | Group | The group to leave |
Returns
boolean
false if not found, true if removed