Skip to content

feat: add slice tool to mcp#1204

Draft
yelizhenden-mdb wants to merge 1 commit intomainfrom
CLOUDP-393141-3
Draft

feat: add slice tool to mcp#1204
yelizhenden-mdb wants to merge 1 commit intomainfrom
CLOUDP-393141-3

Conversation

@yelizhenden-mdb
Copy link
Copy Markdown
Collaborator

Proposed changes

Jira ticket: CLOUDP-393141

This PR implements A new tool that creates a filtered subset of a loaded OpenAPI specification and saves it as a virtual spec for further use.

Input:

  • sourceAlias (required) — alias of the spec to slice
  • saveAs (required) — agent-chosen alias for the resulting virtual spec
  • tags, operationIds, paths (at least one required) — filter criteria, combined with OR logic

Output: success message + the new alias

Key behaviours:

  • Validates saveAs format (lowercase letters, numbers, hyphens) and uniqueness
  • Delegates filtering to FOASCLI slice, which also cleans up unreferenced schemas, parameters, and responses
  • The same source spec can be sliced multiple times under different aliases

Checklist

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works

Changes to Spectral

  • I have read the README file for Spectral Updates

Further comments

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.

1 participant