Skip to content

Commit 5fc85b8

Browse files
committed
fix: review updates
1 parent e3bb7d4 commit 5fc85b8

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

src/server.schema.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ const isZodRawShape = (value: unknown): boolean => {
7272
* @param jsonSchema - Plain JSON Schema object
7373
* @param settings - Optional settings
7474
* @param settings.failFast - Fail fast on unsupported types, or be nice and attempt to convert. Defaults to true.
75-
* @returns Zod schema equivalent
75+
* @returns A Zod schema when convertible, returns undefined when failFast and input are unsupported, or falls back
76+
* to z.any() when failFast `false`
7677
*/
7778
const jsonSchemaToZod = (
7879
jsonSchema: unknown,

src/server.toolsHost.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const serializeError = (errorValue: unknown) => {
8383
/**
8484
* Result of `normalizeCreatorSchema`.
8585
*
86-
* @property tool - The normalized tool creator function.
86+
* @property tool - The realized tool tuple returned by the creator function.
8787
* @property normalizedSchema - Normalized input schema.
8888
* @property manifestSchema - JSON Schema representation of the normalized input schema.
8989
* @property warnings - List of warnings generated during normalization.

src/server.toolsHostCreator.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,26 @@ type ResolveOptions = {
4848
*
4949
* - Probes function exports at most once with toolOptions and never re-probes without options.
5050
* - Supported export shapes:
51-
* - A `default export` that is a function returning a tool tuple -> wraps and caches as a creator (with .toolName)
52-
* - A `default export` that is a function returning an array of functions returning tool tuples -> no unwrapping, returns them directly
53-
* - A `default export` that is an array of functions returning tool tuples -> no unwrapping, returns them directly
51+
* - A `default export` that is a tool creator (function returning a tool tuple) -> wraps and caches as a creator (with .toolName)
52+
* - A `default export` that is a function returning an array of tool creators (functions returning tool tuples) -> no unwrapping, returns them directly
53+
* - A `default export` that is an array of tool creators (functions returning tool tuples) -> no unwrapping, returns them directly
5454
*
5555
* @example
56-
* // A default export function returning a tool tuple
56+
* // A default export creator (function returning a tool tuple)
5757
* export default () => ['toolName', { description: 'recommended', inputSchema: { ... } }, handler];
5858
*
5959
* @example
60-
* // A default export function returning an array of tool tuples
61-
* const dolorSit = () => ['toolName1', { description: 'recommended', inputSchema: { ... } }, handler];
62-
* const ametConsectetur = () => ['toolName2', { description: 'recommended', inputSchema: { ... } }, handler];
60+
* // A default export function returning an array of tool creators (functions returning tool tuples)
61+
* const dolorSit = () => ['toolName1', { description: 'recommended', inputSchema: { ... } }, handler];
62+
* const ametConsectetur = () => ['toolName2', { description: 'recommended', inputSchema: { ... } }, handler];
6363
*
6464
* export default () => [dolorSit, ametConsectetur];
6565
*
6666
* @example
67-
* // A default export array of functions returning tool tuples
67+
* // A default export array of tool creators (functions returning tool tuples)
6868
* export default [
69-
* () => ['toolName1', { description: 'recommended', inputSchema: { ... } }, handler],
70-
* () => ['toolName2', { description: 'recommended', inputSchema: { ... } }, handler]
69+
* () => ['toolName1', { description: 'recommended', inputSchema: { ... } }, handler],
70+
* () => ['toolName2', { description: 'recommended', inputSchema: { ... } }, handler]
7171
* ];
7272
*
7373
* @param moduleExports - The module exports object from the child process.

0 commit comments

Comments
 (0)