Skip to content

Conversation

@ryoppippi
Copy link
Member

@ryoppippi ryoppippi commented Dec 17, 2025

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 class
  • stackone_ai/specs/loader.py - Spec loading utilities
  • scripts/pull_oas.py - OAS download script
  • tests/test_parser.py - Parser unit tests
  • tests/test_toolset.py - OAS-based toolset tests
  • tests/snapshots/ - Parser snapshot files

Modified:

  • stackone_ai/toolset.py - Removed get_tools(), get_tool() methods and OAS imports
  • stackone_ai/constants.py - Removed OAS_DIR constant
  • stackone_ai/server.py - Updated to use fetch_tools() instead of deprecated methods
  • tests/test_feedback.py - Updated to use create_feedback_tool() directly
  • Documentation updated to reflect new architecture

Why

  • Simplification: Tools are now fetched dynamically at runtime via MCP endpoint
  • Consistency: Aligns with Node.js SDK which removed OAS in favour of MCP
  • Maintenance: No need to sync bundled specs with upstream changes
  • Bundle size: Removes ~1.6MB of JSON spec files

Breaking Changes

  • get_tools() and get_tool() methods are removed
  • Use fetch_tools() for all tool loading

Test Plan

  • All existing tests pass (make test - 79 passed, 1 skipped)
  • Linting passes (make lint)
  • Type checking passes (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

    • Removed OAS specs, parser/loader modules, pull script, and related tests/snapshots.
    • Updated StackOneToolSet to use fetch_tools; removed OAS imports and constants.
    • Migrated MCP server handlers to fetch_tools; updated feedback tests to use create_feedback_tool; docs adjusted.
  • Breaking Changes

    • Removed get_tools() and get_tool(). Use fetch_tools() for all tool loading (supports filters like actions and account_id).
    • When calling tools via the server, pass account_id in arguments; call_tool now fetches tools with filters before execution.

Written for commit 1e58c5b. Summary will update automatically on new commits.

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
Copilot AI review requested due to automatic review settings December 17, 2025 14:41
Copy link
Contributor

Copilot AI left a 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() and get_tool() methods from StackOneToolSet
  • 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.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a 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

@ryoppippi ryoppippi closed this Dec 17, 2025
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