@tsed/platform-mcp 8.40.0 → 8.40.2

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.
@@ -8,7 +8,12 @@ import { fromJsonSchema } from "../utils/fromJsonSchema.js";
8
8
  import { asToolResponse } from "../utils/asToolResponse.js";
9
9
  function getOutputSchema(methodStore) {
10
10
  const schema = methodStore.operation.getResponseOf(200)?.getMedia("application/json")?.get("schema");
11
- return schema?.itemSchema();
11
+ // Without @Returns, the schema is inferred from design:returntype (e.g. Promise) and is empty.
12
+ // An empty output schema would force the SDK to require structuredContent on every call.
13
+ if (!schema || !Object.keys(schema.toJSON()).length) {
14
+ return undefined;
15
+ }
16
+ return schema.itemSchema();
12
17
  }
13
18
  function getInputSchema(token, propertyKey) {
14
19
  return s.store(token, propertyKey, 0).schema?.itemSchema();