fastmcp 4.24.5 → 4.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/FastMCP.cjs +3 -3
- package/dist/FastMCP.d.cts +2 -2
- package/dist/FastMCP.d.ts +2 -2
- package/dist/FastMCP.js +2 -2
- package/dist/{OAuthProvider-84BWWDBF.d.cts → OAuthProvider-CPC9zG96.d.cts} +16 -0
- package/dist/{OAuthProvider-84BWWDBF.d.ts → OAuthProvider-CPC9zG96.d.ts} +16 -0
- package/dist/auth/index.cjs +2 -2
- package/dist/auth/index.d.cts +2 -2
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.js +1 -1
- package/dist/bin/fastmcp.cjs +1 -0
- package/dist/bin/fastmcp.cjs.map +1 -1
- package/dist/bin/fastmcp.js +1 -0
- package/dist/bin/fastmcp.js.map +1 -1
- package/dist/{chunk-CAQLTSJ5.js → chunk-3VYVXSBB.js} +42 -7
- package/dist/chunk-3VYVXSBB.js.map +1 -0
- package/dist/{chunk-BV4PWTT6.cjs → chunk-AKHG27NY.cjs} +42 -7
- package/dist/chunk-AKHG27NY.cjs.map +1 -0
- package/dist/{chunk-UYV7MFKA.js → chunk-SQSE766U.js} +39 -15
- package/dist/chunk-SQSE766U.js.map +1 -0
- package/dist/{chunk-P56ABHAK.cjs → chunk-VWHJYU4V.cjs} +42 -18
- package/dist/chunk-VWHJYU4V.cjs.map +1 -0
- package/dist/edge/index.cjs +6 -6
- package/dist/edge/index.cjs.map +1 -1
- package/dist/edge/index.js +6 -6
- package/dist/edge/index.js.map +1 -1
- package/dist/examples/custom-routes.cjs +3 -3
- package/dist/examples/custom-routes.js +2 -2
- package/dist/openapi/index.cjs +51 -34
- package/dist/openapi/index.cjs.map +1 -1
- package/dist/openapi/index.d.cts +8 -3
- package/dist/openapi/index.d.ts +8 -3
- package/dist/openapi/index.js +29 -12
- package/dist/openapi/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-BV4PWTT6.cjs.map +0 -1
- package/dist/chunk-CAQLTSJ5.js.map +0 -1
- package/dist/chunk-P56ABHAK.cjs.map +0 -1
- package/dist/chunk-UYV7MFKA.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cancelResponseBody
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3VYVXSBB.js";
|
|
4
4
|
import {
|
|
5
5
|
objectRootSchema,
|
|
6
6
|
strictInputSchema,
|
|
@@ -1642,22 +1642,41 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
|
|
|
1642
1642
|
}
|
|
1643
1643
|
cachedToolsList = await Promise.all(
|
|
1644
1644
|
tools.map(async (tool) => {
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
inputSchema: tool.parameters ? strictInputSchema(
|
|
1645
|
+
let inputSchema;
|
|
1646
|
+
try {
|
|
1647
|
+
inputSchema = tool.parameters ? strictInputSchema(
|
|
1649
1648
|
tool.parameters["~standard"].vendor === "zod" && "_zod" in tool.parameters ? zodInputSchema(tool.parameters, "draft-7") : await toJsonSchema(tool.parameters)
|
|
1650
1649
|
) : {
|
|
1651
1650
|
additionalProperties: false,
|
|
1652
1651
|
properties: {},
|
|
1653
1652
|
type: "object"
|
|
1654
|
-
}
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1653
|
+
};
|
|
1654
|
+
} catch (error) {
|
|
1655
|
+
this.#logger.warn(
|
|
1656
|
+
`[FastMCP warning] Tool '${tool.name}' parameters cannot be converted to JSON Schema; advertising a generic object schema.`,
|
|
1657
|
+
error
|
|
1658
|
+
);
|
|
1659
|
+
inputSchema = { type: "object" };
|
|
1660
|
+
}
|
|
1661
|
+
let outputSchema;
|
|
1662
|
+
if (tool.outputSchema) {
|
|
1663
|
+
try {
|
|
1664
|
+
outputSchema = objectRootSchema(
|
|
1658
1665
|
await toJsonSchema(tool.outputSchema)
|
|
1659
|
-
)
|
|
1660
|
-
}
|
|
1666
|
+
);
|
|
1667
|
+
} catch (error) {
|
|
1668
|
+
this.#logger.warn(
|
|
1669
|
+
`[FastMCP warning] Tool '${tool.name}' outputSchema cannot be converted to JSON Schema; advertising the tool without it.`,
|
|
1670
|
+
error
|
|
1671
|
+
);
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
return {
|
|
1675
|
+
annotations: tool.annotations,
|
|
1676
|
+
description: tool.description,
|
|
1677
|
+
inputSchema,
|
|
1678
|
+
name: tool.name,
|
|
1679
|
+
...outputSchema && { outputSchema },
|
|
1661
1680
|
// Pass through _meta for MCP ext-apps UI support (issue #229)
|
|
1662
1681
|
...tool._meta && { _meta: tool._meta }
|
|
1663
1682
|
};
|
|
@@ -2117,9 +2136,14 @@ var FastMCP = class extends FastMCPEventEmitter {
|
|
|
2117
2136
|
* Adds prompts to the server.
|
|
2118
2137
|
*/
|
|
2119
2138
|
addPrompts(prompts) {
|
|
2120
|
-
const
|
|
2121
|
-
|
|
2122
|
-
|
|
2139
|
+
const promptsByName = new Map(
|
|
2140
|
+
this.#prompts.map((prompt) => [prompt.name, prompt])
|
|
2141
|
+
);
|
|
2142
|
+
for (const prompt of prompts) {
|
|
2143
|
+
promptsByName.delete(prompt.name);
|
|
2144
|
+
promptsByName.set(prompt.name, prompt);
|
|
2145
|
+
}
|
|
2146
|
+
this.#prompts = Array.from(promptsByName.values());
|
|
2123
2147
|
if (this.#serverState === "running" /* Running */) {
|
|
2124
2148
|
this.#promptsListChanged(this.#prompts);
|
|
2125
2149
|
}
|
|
@@ -3519,4 +3543,4 @@ export {
|
|
|
3519
3543
|
FastMCPSession,
|
|
3520
3544
|
FastMCP
|
|
3521
3545
|
};
|
|
3522
|
-
//# sourceMappingURL=chunk-
|
|
3546
|
+
//# sourceMappingURL=chunk-SQSE766U.js.map
|