Skip to content

Commit 20e2797

Browse files
committed
refactor: cleanup tool.ts comments
1 parent 3e15fee commit 20e2797

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

src/tools/tool.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -282,16 +282,6 @@ export abstract class ToolBase {
282282
/**
283283
* Optional Zod schema defining the tool's structured output.
284284
*
285-
* When defined:
286-
* 1. The MCP SDK will validate `structuredContent` against this schema
287-
* 2. If the tool has a registered UI component, the base class will validate
288-
* `structuredContent` before creating a UIResource. If validation fails,
289-
* the UI is skipped and only the text result is returned.
290-
*
291-
* This enables a clean separation: tools define their output schema and return
292-
* structured data, while the base class handles validation and UI integration
293-
* automatically.
294-
*
295285
* @example
296286
* ```typescript
297287
* protected outputSchema = {
@@ -732,14 +722,7 @@ export abstract class ToolBase {
732722
}
733723

734724
/**
735-
* Automatically appends a UIResource to the tool result if:
736-
* 1. The tool has a registered UI component
737-
* 2. The result contains `structuredContent`
738-
* 3. If `outputSchema` is defined, `structuredContent` must validate against it
739-
*
740-
* This method is called automatically after `execute()` in the `register()` callback.
741-
* Tools don't need to call this directly - they just need to return `structuredContent`
742-
* in their result and the base class handles the rest.
725+
* Appends a UIResource to the tool result.
743726
*
744727
* @param result - The result from the tool's `execute()` method
745728
* @returns The result with UIResource appended if conditions are met, otherwise unchanged

0 commit comments

Comments
 (0)