Skip to content

Conversation

@ryoppippi
Copy link
Member

@ryoppippi ryoppippi commented Dec 5, 2025

Summary

Remove all deprecated OpenAPI Specification (OAS) based tool generation and migrate exclusively to the MCP-based fetch_tools() API.

This PR mirrors the changes made in the Node SDK: StackOneHQ/stackone-ai-node#148

Breaking Changes

  • get_tools() method removed from StackOneToolSet
  • get_tool() method removed from StackOneToolSet
  • OpenAPI spec parser and loader removed
  • Bundled OAS JSON files removed (~1.5MB)
  • Python 3.10+ now required for fetch_tools()

Changes

Deleted:

  • stackone_ai/oas/ directory (8 JSON spec files)
  • stackone_ai/specs/ directory (parser.py, loader.py)
  • tests/test_parser.py and related snapshots
  • examples/available_tools.py, custom_base_url.py, error_handling.py

Modified:

  • StackOneToolSet - now only exposes fetch_tools()
  • stackone_ai/constants.py - removed OAS_DIR constant
  • stackone_ai/server.py - updated to use fetch_tools()
  • All examples updated to use fetch_tools()
  • Tests updated for new API
  • README.md - updated documentation with migration guide

Migration

Before:

tools = toolset.get_tools("hris_*", account_id="acc-123")

After:

tools = toolset.fetch_tools(actions=["hris_*"], account_ids=["acc-123"])

Test plan

  • All unit tests pass (93 passed, 1 skipped)
  • Linting passes (ruff, ruff-format)
  • Type checking passes (mypy)
  • Pre-commit hooks pass

Summary by cubic

Removed deprecated OAS-based tool generation and moved the SDK to MCP-backed fetch_tools() only. This is a breaking change that simplifies the API and enables dynamic tool discovery.

  • Refactors

    • Removed StackOneToolSet.get_tools() and StackOneToolSet.get_tool().
    • Deleted bundled OAS specs and OpenAPI parser/loader (~1.5MB removed).
    • Updated server, examples, tests, and README to use fetch_tools().
    • Python 3.10+ now required.
    • Bumped package version to 0.3.4.
  • Migration

    • Before: toolset.get_tools("hris_*", account_id="acc-123")
    • After: toolset.fetch_tools(actions=["hris_*"], account_ids=["acc-123"])

Written for commit 72e0940. Summary will update automatically on new commits.

…s only

Remove all deprecated OpenAPI Specification (OAS) based tool generation
and migrate exclusively to the MCP-based fetch_tools() API.

BREAKING CHANGES:
- get_tools() method removed from StackOneToolSet
- get_tool() method removed from StackOneToolSet
- OpenAPI spec parser and loader removed
- Bundled OAS JSON files removed (~1.5MB)
- Python 3.10+ now required for fetch_tools()

Deleted:
- stackone_ai/oas/ directory (8 JSON spec files)
- stackone_ai/specs/ directory (parser.py, loader.py)
- tests/test_parser.py and related snapshots
- examples/available_tools.py, custom_base_url.py, error_handling.py

Modified:
- StackOneToolSet: now only exposes fetch_tools()
- stackone_ai/constants.py: removed OAS_DIR constant
- stackone_ai/server.py: updated to use fetch_tools()
- All examples updated to use fetch_tools()
- Tests updated for new API
- README.md: updated documentation with migration guide

Migration path:
  Before: toolset.get_tools("hris_*", account_id="acc-123")
  After:  toolset.fetch_tools(actions=["hris_*"], account_ids=["acc-123"])

This aligns the Python SDK with the Node SDK architecture (PR #148),
removing maintenance burden of bundled OAS specs and enabling
dynamic tool discovery via MCP.
Copilot AI review requested due to automatic review settings December 5, 2025 15:23
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 introduces a breaking change by removing the deprecated OpenAPI Specification (OAS)-based tool generation system and migrating exclusively to the MCP-based fetch_tools() API. This aligns the Python SDK with the Node SDK implementation and removes approximately 1.5MB of bundled OAS JSON files.

Key changes include:

  • Complete removal of OAS-based tool loading infrastructure (specs, parser, loader)
  • Removal of get_tools() and get_tool() methods from StackOneToolSet
  • Migration of all examples and tests to use fetch_tools() API
  • Updated MCP server implementation to use the new API

Reviewed changes

Copilot reviewed 28 out of 37 changed files in this pull request and generated no comments.

Show a summary per file
File Description
stackone_ai/toolset.py Removed deprecated get_tools(), get_tool(), and _parse_parameters() methods; removed unused imports
stackone_ai/specs/parser.py Deleted entire OpenAPI parser implementation (231 lines)
stackone_ai/specs/loader.py Deleted OAS spec loader (20 lines)
stackone_ai/constants.py Removed OAS_DIR constant; fixed "optimized" spelling to British English
stackone_ai/server.py Updated to use fetch_tools() instead of deprecated methods
tests/test_toolset.py Removed all OAS-based tests, added new filter matching tests
tests/test_parser.py Deleted entire parser test file (731 lines)
tests/test_feedback.py Updated to use create_feedback_tool() directly, added skip marker
examples/stackone_account_ids.py Updated example to use fetch_tools() with proper parameter names
examples/test_examples.py Updated dependency requirements and removed mock responses
uv.lock Version bump to 0.3.4
Multiple OAS JSON files Deleted all bundled OpenAPI specification files
Multiple snapshot files Deleted all parser test snapshots

💡 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 37 files

@ryoppippi ryoppippi changed the title refactor!: remove deprecated OAS-based getTools, migrate to fetchTools only feat!: remove deprecated OAS-based getTools, migrate to fetchTools only Dec 8, 2025
def crewai_integration():
toolset = StackOneToolSet()
tools = toolset.get_tools("hris_*", account_id=account_id)
tools = toolset.fetch_tools(actions=["hris_*"], account_ids=[account_id])
Copy link
Contributor

@glebedel glebedel Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this hris_ example is useful anymore as we dont prefix with categories. Actions are like this list_workers so maybe as an example *_workers is better or *list_*

(and that's the case for everywhere we mention a category, eg. hris, ats etc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i'll fix it later!!

@ryoppippi ryoppippi enabled auto-merge (squash) December 17, 2025 18:38
Copy link

@StuBehan StuBehan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ryoppippi ryoppippi merged commit d50d5fb into main Dec 17, 2025
12 checks passed
@ryoppippi ryoppippi deleted the refactor/remove-oas-migrate-to-fetch-tools branch December 17, 2025 19:15
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.

4 participants