-
Notifications
You must be signed in to change notification settings - Fork 0
chore: remove OAS-based implementation in favour of MCP dynamic tool fetching #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Remove all OpenAPI specification JSON files from stackone_ai/oas/: - ats.json, core.json, crm.json, documents.json - hris.json, iam.json, lms.json, marketing.json Also remove scripts/pull_oas.py which was used to download these specs from docs.stackone.com. These files are no longer needed as the SDK now uses MCP-backed dynamic tool fetching instead of parsing bundled OAS specs. This aligns with the Node.js SDK architecture which removed OAS in favour of runtime tool discovery via MCP endpoint.
Remove stackone_ai/specs/ directory containing: - parser.py: OpenAPIParser class for converting OAS to tool definitions - loader.py: Utility for loading specs These modules handled: - Schema reference resolution ($ref) - allOf schema merging - File upload detection (format: binary) - Request body parsing - Parameter location mapping No longer needed as tools are now fetched dynamically via MCP endpoint rather than parsed from bundled specifications.
Remove OAS-based tool loading in favour of MCP-backed fetch_tools: - Remove OAS_DIR constant from constants.py - Remove get_tools() method that loaded tools from bundled specs - Remove get_tool() method that retrieved single tool by name - Remove _parse_parameters() helper for OpenAPI parameter parsing - Remove OpenAPIParser and OAS_DIR imports from toolset.py - Remove unused warnings import The SDK now exclusively uses fetch_tools() which dynamically retrieves tool definitions from the MCP endpoint at runtime. BREAKING CHANGE: get_tools() and get_tool() methods are removed. Use fetch_tools() instead for all tool loading.
Update MCP server handlers to use dynamic tool fetching: list_tools(): - Replace get_tools() with fetch_tools() call_tool(): - Extract account_id from arguments before fetching - Use fetch_tools() with actions filter to get specific tool - Pass account_id to fetch_tools() when provided This completes the migration from OAS-based tool loading to MCP-backed dynamic tool fetching in the server component.
Remove tests that depended on OAS-based implementation: - tests/test_parser.py: OpenAPIParser unit tests - tests/test_toolset.py: get_tools/get_tool integration tests - tests/snapshots/: Snapshot files for parsed OAS specs Update tests/test_feedback.py: - test_tool_integration: Use create_feedback_tool directly instead of fetching via deprecated get_tools() method - test_live_feedback_submission: Same change for live test All remaining tests pass with the new MCP-based architecture.
Update CLAUDE.md: - Remove references to OpenAPI Parser and OAS specs - Update StackOneToolSet description to mention MCP endpoint - Replace get_tools example with fetch_tools usage - Remove "Adding New SaaS Integration" section (no longer applicable) - Update "Modifying Tool Behavior" section with RPC tool info Update .cursor/rules/no-relative-imports.mdc: - Replace OAS_DIR import examples with DEFAULT_HYBRID_ALPHA
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR removes all OpenAPI Specification (OAS) based implementation, transitioning entirely to MCP-backed dynamic tool fetching. This aligns the Python SDK architecture with the Node.js SDK and simplifies maintenance by eliminating ~1.6MB of bundled JSON spec files.
Key Changes:
- Removed OAS JSON specs, parser, and loader modules (~60k lines of JSON specs and parsing code)
- Removed
get_tools()andget_tool()methods fromStackOneToolSet - Updated MCP server to use
fetch_tools()for tool retrieval
Reviewed changes
Copilot reviewed 19 out of 27 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_toolset.py | Deleted entire test file for OAS-based toolset functionality (273 lines) |
| tests/test_parser.py | Deleted entire test file for OpenAPI parser (731 lines) |
| tests/snapshots/* | Deleted all parser snapshot files (marketing, iam, documents, crm, core tools) |
| stackone_ai/toolset.py | Removed get_tools(), get_tool() methods and OAS-related imports |
| stackone_ai/server.py | Updated MCP server to use fetch_tools() instead of deprecated methods |
| tests/test_feedback.py | Updated to use create_feedback_tool() directly instead of through toolset |
| stackone_ai/specs/parser.py | Deleted entire OpenAPI parser module (231 lines) |
| stackone_ai/specs/loader.py | Deleted entire spec loader module (20 lines) |
| stackone_ai/oas/iam.json | Deleted bundled IAM OAS spec file (3441 lines) |
| stackone_ai/constants.py | Removed OAS_DIR constant |
| scripts/pull_oas.py | Deleted OAS download script (89 lines) |
| .cursor/rules/no-relative-imports.mdc | Updated documentation examples to reflect new module structure |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 27 files
Summary
Remove all OpenAPI Specification (OAS) based implementation, migrating entirely to MCP-backed dynamic tool fetching. This aligns the Python SDK architecture with the Node.js SDK.
What Changed
Removed:
stackone_ai/oas/*.json- 8 bundled OAS spec files (~60k lines)stackone_ai/specs/parser.py- OpenAPIParser classstackone_ai/specs/loader.py- Spec loading utilitiesscripts/pull_oas.py- OAS download scripttests/test_parser.py- Parser unit teststests/test_toolset.py- OAS-based toolset teststests/snapshots/- Parser snapshot filesModified:
stackone_ai/toolset.py- Removedget_tools(),get_tool()methods and OAS importsstackone_ai/constants.py- RemovedOAS_DIRconstantstackone_ai/server.py- Updated to usefetch_tools()instead of deprecated methodstests/test_feedback.py- Updated to usecreate_feedback_tool()directlyWhy
Breaking Changes
get_tools()andget_tool()methods are removedfetch_tools()for all tool loadingTest Plan
make test- 79 passed, 1 skipped)make lint)make mypy)Summary by cubic
Switched the Python SDK from OAS-based tooling to MCP-backed dynamic tool fetching. This simplifies runtime tool discovery, aligns with the Node.js SDK, and removes ~1.6MB of bundled JSON specs.
Refactors
Breaking Changes
Written for commit 1e58c5b. Summary will update automatically on new commits.