fastmcp 4.28.3 → 4.28.4

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  cancelResponseBody
3
- } from "./chunk-2RLFFOY2.js";
3
+ } from "./chunk-UFPH23EN.js";
4
4
  import {
5
5
  objectRootSchema,
6
6
  strictInputSchema,
@@ -1651,7 +1651,7 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1651
1651
  tools: cachedToolsList
1652
1652
  };
1653
1653
  }
1654
- cachedToolsList = await Promise.all(
1654
+ const listedTools = await Promise.all(
1655
1655
  tools.map(async (tool) => {
1656
1656
  let inputSchema;
1657
1657
  try {
@@ -1669,6 +1669,12 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1669
1669
  );
1670
1670
  inputSchema = { type: "object" };
1671
1671
  }
1672
+ if (inputSchema.type !== "object") {
1673
+ this.#logger.warn(
1674
+ `[FastMCP warning] Tool '${tool.name}' parameters must describe an object. Omitting the tool from tools/list.`
1675
+ );
1676
+ return void 0;
1677
+ }
1672
1678
  let outputSchema;
1673
1679
  if (tool.outputSchema) {
1674
1680
  try {
@@ -1681,18 +1687,27 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1681
1687
  error
1682
1688
  );
1683
1689
  }
1690
+ if (outputSchema && outputSchema.type !== "object") {
1691
+ this.#logger.warn(
1692
+ `[FastMCP warning] Tool '${tool.name}' outputSchema must describe an object. Omitting the tool from tools/list.`
1693
+ );
1694
+ return void 0;
1695
+ }
1684
1696
  }
1685
1697
  return {
1686
1698
  annotations: tool.annotations,
1687
1699
  description: tool.description,
1688
1700
  inputSchema,
1689
1701
  name: tool.name,
1690
- ...outputSchema && { outputSchema },
1702
+ ...outputSchema && {
1703
+ outputSchema
1704
+ },
1691
1705
  // Pass through _meta for MCP ext-apps UI support (issue #229)
1692
1706
  ...tool._meta && { _meta: tool._meta }
1693
1707
  };
1694
1708
  })
1695
1709
  );
1710
+ cachedToolsList = listedTools.filter((tool) => tool !== void 0);
1696
1711
  return {
1697
1712
  tools: cachedToolsList
1698
1713
  };
@@ -3712,4 +3727,4 @@ export {
3712
3727
  FastMCPSession,
3713
3728
  FastMCP
3714
3729
  };
3715
- //# sourceMappingURL=chunk-GAPP6V64.js.map
3730
+ //# sourceMappingURL=chunk-Q57EM4LH.js.map