Skip to content

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

typescript
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

Extends

Constructors

Constructor

ts
new Tool(name): Tool;

Defined in: packages/core/src/domain/Tool.ts:39

Parameters

ParameterType
namestring

Returns

Tool

Overrides

ts
GroupItem.constructor

Properties

description

ts
description: string | undefined;

Defined in: packages/core/src/domain/BaseModel.ts:33

Detailed description of this entity's purpose

Inherited from

GroupItem.description


icons

ts
icons: Icon[] | undefined;

Defined in: packages/core/src/domain/BaseModel.ts:37

Visual icons associated with this entity

Inherited from

GroupItem.icons


inputSchema

ts
inputSchema: string | undefined;

Defined in: packages/core/src/domain/Tool.ts:33

JSON Schema string describing the tool's input parameters


meta

ts
meta: Map<string, unknown> | undefined;

Defined in: packages/core/src/domain/BaseModel.ts:35

Arbitrary key-value metadata for extensibility

Inherited from

GroupItem.meta


name

ts
readonly name: string;

Defined in: packages/core/src/domain/BaseModel.ts:29

Unique identifier within the parent scope

Inherited from

GroupItem.name


nameSeparator

ts
readonly nameSeparator: string;

Defined in: packages/core/src/domain/BaseModel.ts:27

Separator character for constructing fully qualified names

Inherited from

GroupItem.nameSeparator


outputSchema

ts
outputSchema: string | undefined;

Defined in: packages/core/src/domain/Tool.ts:35

JSON Schema string describing the tool's output format


parentGroups

ts
readonly parentGroups: Group[];

Defined in: packages/core/src/domain/GroupItem.ts:28

Groups that contain this item (many-to-many relationship)

Inherited from

GroupItem.parentGroups


title

ts
title: string | undefined;

Defined in: packages/core/src/domain/BaseModel.ts:31

Human-readable display title

Inherited from

GroupItem.title


toolAnnotations

ts
toolAnnotations: ToolAnnotations | undefined;

Defined in: packages/core/src/domain/Tool.ts:37

MCP annotations providing behavioral hints to LLMs


DEFAULT_SEPARATOR

ts
readonly static DEFAULT_SEPARATOR: string = ".";

Defined in: packages/core/src/domain/BaseModel.ts:24

Default separator used in fully qualified names

Inherited from

GroupItem.DEFAULT_SEPARATOR

Methods

addParentGroup()

ts
addParentGroup(parentGroup): boolean;

Defined in: packages/core/src/domain/GroupItem.ts:41

Add this item to a parent group.

Parameters

ParameterTypeDescription
parentGroupGroupThe group to join

Returns

boolean

false if already a member, true if added

Inherited from

GroupItem.addParentGroup


getFullyQualifiedName()

ts
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()

ts
removeParentGroup(parentGroup): boolean;

Defined in: packages/core/src/domain/GroupItem.ts:53

Remove this item from a parent group.

Parameters

ParameterTypeDescription
parentGroupGroupThe group to leave

Returns

boolean

false if not found, true if removed

Inherited from

GroupItem.removeParentGroup