Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ from stackone_adk import StackOnePlugin

async def main():
# StackOne replaces manual tool functions
plugin = StackOnePlugin() # reads STACKONE_API_KEY from env
# Reads STACKONE_API_KEY from env and uses the specified account_id
plugin = StackOnePlugin(account_id="YOUR_ACCOUNT_ID")

agent = Agent(
model="gemini-2.5-flash",
Expand All @@ -95,7 +96,7 @@ asyncio.run(main())
from google.adk.apps import App
from google.adk.runners import InMemoryRunner

plugin = StackOnePlugin(providers=["calendly"])
plugin = StackOnePlugin(account_id="YOUR_ACCOUNT_ID")

agent = Agent(
model="gemini-2.5-flash",
Expand All @@ -114,7 +115,7 @@ async with InMemoryRunner(app=app) as runner:
```python
from google.adk.runners import InMemoryRunner

plugin = StackOnePlugin(providers=["calendly"])
plugin = StackOnePlugin(account_id="YOUR_ACCOUNT_ID")

agent = Agent(
model="gemini-2.5-flash",
Expand All @@ -140,6 +141,18 @@ async with InMemoryRunner(app_name="calendly_app", agent=agent) as runner:

## Tool Filtering

### By Account ID (Recommended)

Scope tools to specific connected accounts. This is the recommended approach to ensure your agent only accesses the intended accounts:

```python
# Single account
plugin = StackOnePlugin(account_id="YOUR_ACCOUNT_ID")

# Multiple accounts
plugin = StackOnePlugin(account_ids=["acct-hibob-1", "acct-bamboohr-1"])
```

### By Provider

Filter tools to specific SaaS providers:
Expand All @@ -164,15 +177,6 @@ plugin = StackOnePlugin(actions=["*_list_*", "*_get_*"])
plugin = StackOnePlugin(actions=["calendly_list_events", "calendly_get_event_*"])
```

### By Account ID

Scope tools to specific connected accounts:

```python
# Multiple accounts
plugin = StackOnePlugin(account_ids=["acct-hibob-1", "acct-bamboohr-1"])
```

### Combining Filters

```python
Expand All @@ -189,7 +193,7 @@ Unlike plugins with a fixed set of tools, StackOne tools are **dynamically disco
Print discovered tools:

```python
plugin = StackOnePlugin(providers=["calendly"])
plugin = StackOnePlugin(account_id="YOUR_ACCOUNT_ID", providers=["calendly"])
for tool in plugin.get_tools():
print(f"{tool.name}: {tool.description}")
```
Expand Down
11 changes: 7 additions & 4 deletions examples/calendly_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
so you don't need to define tool functions manually. Just connect your
Calendly account and the tools are ready to use:

plugin = StackOnePlugin()
plugin = StackOnePlugin(account_id="YOUR_ACCOUNT_ID")
agent = Agent(
model="gemini-2.5-flash",
name="calendly_agent",
tools=plugin.get_tools(),
)

You can pass an account_id to scope tools to a specific connected account,
or omit it to let the plugin auto-discover all connected accounts.

Setup:
1. Get your StackOne API key from https://app.stackone.com
2. Connect your Calendly account in the StackOne dashboard
Expand All @@ -35,11 +38,11 @@


async def main() -> None:
# Discovers tools from your connected providers
# Discovers tools from your connected providers.
plugin = StackOnePlugin()

Copilot AI Feb 17, 2026

Copy link

Choose a reason for hiding this comment

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

Inconsistency between docstring example and actual code: The docstring on line 7 shows using account_id as the primary approach, but the actual implementation on line 44 omits it to demonstrate auto-discovery. Given the PR's goal to "make the account ID usage primary", consider updating line 44 to match the docstring example or updating the docstring to reflect that this example demonstrates auto-discovery.

Copilot uses AI. Check for mistakes.

# Optionally filter by provider or scope to a specific account:
# plugin = StackOnePlugin(providers=["calendly"], account_id="your-account-id")
# You can also pass account_id to scope tools to a specific connected account:
# plugin = StackOnePlugin(account_id="YOUR_ACCOUNT_ID")

tools = plugin.get_tools()
print(f"Discovered {len(tools)} Calendly tools\n")
Expand Down