<!--
 ⚠️  AUTO-GENERATED FILE - DO NOT EDIT MANUALLY
 This file is automatically generated by scripts/docs-generator.js
 To make changes, edit the source TypeScript files or update the generator script
-->

[agents](../../) / [Exports](../modules) / RelayMcpTool

# Class: RelayMcpTool

RelayMcpTool

Minimal relay tool for third-party MCP commands that need to spin up a Robota-based flow.

- Caller provides tool-bound EventService and ownerPath (up to tool segment).
- This tool appends a single agent segment and forwards control to the provided run() callback.
- No prefix injection, no ownerPath inference, no fallback/clone/context creation inside.

## Hierarchy

- `AbstractTool`\<[`TToolParameters`](../modules#ttoolparameters), [`IToolResult`](../interfaces/IToolResult)\>

  ↳ **`RelayMcpTool`**

## Table of contents

### Constructors

- [constructor](RelayMcpTool#constructor)

### Properties

- [schema](RelayMcpTool#schema)

### Methods

- [setEventService](RelayMcpTool#seteventservice)
- [execute](RelayMcpTool#execute)
- [validate](RelayMcpTool#validate)
- [validateParameters](RelayMcpTool#validateparameters)
- [getDescription](RelayMcpTool#getdescription)
- [getName](RelayMcpTool#getname)

## Constructors

### constructor

• **new RelayMcpTool**(`options`): [`RelayMcpTool`](RelayMcpTool)

#### Parameters

| Name      | Type                                                 |
| :-------- | :--------------------------------------------------- |
| `options` | [`IRelayMcpOptions`](../interfaces/IRelayMcpOptions) |

#### Returns

[`RelayMcpTool`](RelayMcpTool)

#### Overrides

AbstractTool\&lt;TToolParameters, IToolResult\&gt;.constructor

#### Defined in

[packages/agents/src/tools/implementations/relay-mcp-tool.ts:40](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/tools/implementations/relay-mcp-tool.ts#L40)

## Properties

### schema

• `Readonly` **schema**: [`IToolSchema`](../interfaces/IToolSchema)

#### Overrides

AbstractTool.schema

#### Defined in

[packages/agents/src/tools/implementations/relay-mcp-tool.ts:37](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/tools/implementations/relay-mcp-tool.ts#L37)

## Methods

### setEventService

▸ **setEventService**(`eventService`): `void`

Set EventService for post-construction injection

🎯 DEPENDENCY INJECTION:
Accepts EventService as-is without transformation
Caller is responsible for providing properly configured EventService

#### Parameters

| Name           | Type                                                          | Description                                                                         |
| :------------- | :------------------------------------------------------------ | :---------------------------------------------------------------------------------- |
| `eventService` | `undefined` \| [`IEventService`](../interfaces/IEventService) | EventService instance to use for event emission (or undefined for silent operation) |

#### Returns

`void`

#### Inherited from

AbstractTool.setEventService

#### Defined in

[packages/agents/src/abstracts/abstract-tool.ts:152](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-tool.ts#L152)

---

### execute

▸ **execute**(`parameters`, `context`): `Promise`\<[`IToolResult`](../interfaces/IToolResult)\>

Execute tool with simplified lifecycle

#### Parameters

| Name         | Type                                                           | Description                |
| :----------- | :------------------------------------------------------------- | :------------------------- |
| `parameters` | [`TToolParameters`](../modules#ttoolparameters)                | Tool parameters            |
| `context`    | [`IToolExecutionContext`](../interfaces/IToolExecutionContext) | Optional execution context |

#### Returns

`Promise`\<[`IToolResult`](../interfaces/IToolResult)\>

Promise resolving to tool result

#### Inherited from

AbstractTool.execute

#### Defined in

[packages/agents/src/abstracts/abstract-tool.ts:184](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-tool.ts#L184)

---

### validate

▸ **validate**(`parameters`): `boolean`

#### Parameters

| Name         | Type                                            |
| :----------- | :---------------------------------------------- |
| `parameters` | [`TToolParameters`](../modules#ttoolparameters) |

#### Returns

`boolean`

#### Inherited from

AbstractTool.validate

#### Defined in

[packages/agents/src/abstracts/abstract-tool.ts:198](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-tool.ts#L198)

---

### validateParameters

▸ **validateParameters**(`parameters`): [`IParameterValidationResult`](../interfaces/IParameterValidationResult)

Validate tool parameters with detailed result (default implementation)

#### Parameters

| Name         | Type                                            |
| :----------- | :---------------------------------------------- |
| `parameters` | [`TToolParameters`](../modules#ttoolparameters) |

#### Returns

[`IParameterValidationResult`](../interfaces/IParameterValidationResult)

#### Inherited from

AbstractTool.validateParameters

#### Defined in

[packages/agents/src/abstracts/abstract-tool.ts:206](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-tool.ts#L206)

---

### getDescription

▸ **getDescription**(): `string`

#### Returns

`string`

#### Inherited from

AbstractTool.getDescription

#### Defined in

[packages/agents/src/abstracts/abstract-tool.ts:223](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-tool.ts#L223)

---

### getName

▸ **getName**(): `string`

#### Returns

`string`

#### Inherited from

AbstractTool.getName

#### Defined in

[packages/agents/src/abstracts/abstract-tool.ts:227](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-tool.ts#L227)
