Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

test(mcp-host): check the schemas under additionalProperties for portability too

marcotebb3c8f146dc2b
diff --git a/mcp-host/src/workflow/__tests__/internalTools.schemaPortability.test.ts b/mcp-host/src/workflow/__tests__/internalTools.schemaPortability.test.ts
index 198e609fb..ad914b4e2 100644
--- a/mcp-host/src/workflow/__tests__/internalTools.schemaPortability.test.ts
+++ b/mcp-host/src/workflow/__tests__/internalTools.schemaPortability.test.ts
@@ -57,8 +57,8 @@ function typesOf(node: Node): string[] {
}
/**
- * Visit every schema node, including the branches of an `anyOf`, and report
- * those that break `check`.
+ * Visit every schema node, including the branches of an `anyOf` and the
+ * schema of `additionalProperties`, and report those that break `check`.
*/
function scan(check: (node: Node) => string | undefined): Violation[] {
const out: Violation[] = []
@@ -72,6 +72,7 @@ function scan(check: (node: Node) => string | undefined): Violation[] {
}
if (node.items !== undefined) visit(node.items, `${path}[]`)
if (Array.isArray(node.anyOf)) node.anyOf.forEach((b, i) => visit(b, `${path}|${i}`))
+ if (isNode(node.additionalProperties)) visit(node.additionalProperties, `${path}{*}`)
}
visit(tool.parameters, '')
}
@@ -88,6 +89,11 @@ describe('artifact tool schemas stay portable across providers', () => {
expect(ARTIFACT_TOOLS.length).toBeGreaterThanOrEqual(6)
})
+ it('reaches the schemas under additionalProperties', () => {
+ const visited = scan(() => 'visited').filter(v => v.path.endsWith('{*}'))
+ expect(visited.length).toBeGreaterThanOrEqual(9)
+ })
+
it('never uses a keyword the Gemini conversion passes through untranslated', () => {
const bad = scan(node => {
const hit = UNTRANSLATED_KEYWORDS.find(k => node[k] !== undefined)