feat(den-mcp): expose bounded input schemas in capability search and refuse un-constructible executes#2758
Open
benjaminshafii wants to merge 1 commit into
Open
feat(den-mcp): expose bounded input schemas in capability search and refuse un-constructible executes#2758benjaminshafii wants to merge 1 commit into
benjaminshafii wants to merge 1 commit into
Conversation
…refuse un-constructible executes
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
search_capabilitieson/mcp/agentreturned external MCP tool matches withpathParams: [], queryParams: [], hasBody: true— the liveinputSchema(whichlistExternalMcpToolsalready fetches, and which the admin route/v1/mcp-connections/:id/toolsalready returns) was discarded. The calling model had to guess tool arguments, producing empty/garbage payload calls at providers (theSyntaxError: Empty JSON stringclass of failures seen in an enterprise ServiceNow debugging session).What changed
inputSummaryon external tool matches (searchExternalCapabilities): a bounded rendering of the tool's JSON schema —{ required, properties: { name: { type, description, enum } }, truncated? }:truncated: truewhenever anything was cut;"object", arrays →"array<primitive>"/"array"; defensive parsing with type guards throughout.schemaHash: sha256 of the recursively key-sorted schema JSON, first 12 hex chars — detects provider schema drift between search and execute.executeExternalCapabilitywith an empty args object now pre-checks the live tool schema; if the tool declares non-emptyrequired, it returns a structuredmissing_required_argumentserror naming the fields and carryinginputSummary+schemaHashinstead of forwarding an empty payload to the provider. The pre-check is best-effort (discovery failure falls through to the normal call path) and is skipped entirely when args are non-empty — zero added latency on the happy path.search_capabilitiestool description mentionsinputSummary.Testing
pnpm --filter @openwork-ee/den-api exec bun test test/external-capabilities-input-schema.test.ts— 5 pass (summary bounding + truncation flag, hash stability across key order, empty-args refusal with required fields and no provider call, empty-args passthrough when nothing required, non-empty args skip the pre-check).pnpm --filter @openwork-ee/den-api exec bun test test/external-capabilities-search-divergence.test.ts— 17 pass, 0 fail (unchanged behavior preserved).pnpm --filter @openwork-ee/den-api exec tsc --noEmit— clean.No video/fraimz attached: Den API/MCP surface change covered by the unit tests above. Reviewer repro: connect any external MCP whose tool declares required fields, run
search_capabilities(observeinputSummary/schemaHashon the match), thenexecute_capabilitywith an empty body (observemissing_required_argumentsnaming the fields, provider untouched).Notes
ExternalCapabilityMatch/ExternalCapabilityExecuteResult; no change to REST catalog matches.