Skip to content

feat: allow per-instance allowedTools override for schema-rich MCP applications - #1875

Open
ekarankow wants to merge 2 commits into
developmentfrom
feat/schema-rich-allowed-tools-override
Open

ekarankow wants to merge 2 commits into
developmentfrom
feat/schema-rich-allowed-tools-override

Conversation

@ekarankow

Copy link
Copy Markdown
Contributor

[…](feat: allow per-instance allowedTools override for schema-rich MCP applications

For schema-rich Applications (those with applicationTypeSchemaId), an instance's own mcp.allowedTools now intersects with (narrows) the application type's dial:applicationTypeMcp.dial:allowedTools, instead of being ignored.

This allows individual application instances to further restrict which MCP tools they expose, while the application type still defines the base set of allowed tools. The instance can only narrow the type's list, never widen it:

  • Type's allowedTools: ["tool1", "tool2"]
  • Instance's allowedTools: ["tool1", "other_tool"]
  • Effective: ["tool1"] (intersection)

If the type's allowedTools is empty (unrestricted), the instance's list is used as-is.

Changes:

  • ApplicationSchemaService.getMcp(): implements intersection logic before returning
  • ApplicationSchemaServiceTest: unit tests for no-override, intersection, and unrestricted-type cases
  • CustomApplicationApiTest: E2E test exercising tools/list and tools/call filtering
  • Schema/docs: updated custom-application-schemas/schema.json, applications.md, and open_api_core.yaml to document the new narrowing behavior

Applicable issues

  • fixes #

Description of changes

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

…plications

For schema-rich Applications (those with applicationTypeSchemaId), an instance's
own mcp.allowedTools now intersects with (narrows) the application type's
dial:applicationTypeMcp.dial:allowedTools, instead of being ignored.

This allows individual application instances to further restrict which MCP tools
they expose, while the application type still defines the base set of allowed tools.
The instance can only narrow the type's list, never widen it:
- Type's allowedTools: ["tool1", "tool2"]
- Instance's allowedTools: ["tool1", "other_tool"]
- Effective: ["tool1"] (intersection)

If the type's allowedTools is empty (unrestricted), the instance's list is used as-is.

Changes:
- ApplicationSchemaService.getMcp(): implements intersection logic before returning
- ApplicationSchemaServiceTest: unit tests for no-override, intersection, and
  unrestricted-type cases
- CustomApplicationApiTest: E2E test exercising tools/list and tools/call filtering
- Schema/docs: updated custom-application-schemas/schema.json, applications.md, and
  open_api_core.yaml to document the new narrowing behavior
@ai-dial-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants