@devries-cameron20 / composio Mirror · read-only / commits / 67329eb6b
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 22, 13:15 UTC

docs: Update Python SDK reference (#2366)

Co-authored-by: haxzie <53584487+haxzie@users.noreply.github.com>

github-actions[bot] committed Jan 23, 2026 at 13:55 UTC 67329eb6b9e6b4f71f48d30567ee9b2ba85ce256
4 files changed +67 -12
docs/content/reference/sdk-reference/python/composio.mdx
+1 -1
@@ -13,4 +13,4 @@ description: Composio SDK for Python.
13 | [`auth_configs`](/reference/sdk-reference/python/auth-configs) | `AuthConfigs` |
14 | [`connected_accounts`](/reference/sdk-reference/python/connected-accounts) | `ConnectedAccounts` |
15
16 -[View source](https://github.com/composiohq/composio/blob/next/python/composio/sdk.py#L52)
16 +[View source](https://github.com/composiohq/composio/blob/next/python/composio/sdk.py#L53)
docs/content/reference/sdk-reference/python/index.mdx
+3 -3
@@ -52,7 +52,7 @@ result = composio.tools.execute(
52
53 ### before_execute
54
55 -[View source](https://github.com/composiohq/composio/blob/next/python/composio/core/models/_modifiers.py#L171)
55 +[View source](https://github.com/composiohq/composio/blob/next/python/composio/core/models/_modifiers.py#L183)
56
57 ```python
58 @before_execute(modifier: BeforeExecute | None = ..., tools: List[str | None] = ..., toolkits: List[str | None] = ...)
@@ -62,7 +62,7 @@ def my_modifier(...):
62
63 ### after_execute
64
65 -[View source](https://github.com/composiohq/composio/blob/next/python/composio/core/models/_modifiers.py#L132)
65 +[View source](https://github.com/composiohq/composio/blob/next/python/composio/core/models/_modifiers.py#L144)
66
67 ```python
68 @after_execute(modifier: AfterExecute | None = ..., tools: List[str | None] = ..., toolkits: List[str | None] = ...)
@@ -72,7 +72,7 @@ def my_modifier(...):
72
73 ### schema_modifier
74
75 -[View source](https://github.com/composiohq/composio/blob/next/python/composio/core/models/_modifiers.py#L210)
75 +[View source](https://github.com/composiohq/composio/blob/next/python/composio/core/models/_modifiers.py#L222)
76
77 ```python
78 @schema_modifier(modifier: SchemaModifier | None = ..., tools: List[str | None] = ..., toolkits: List[str | None] = ...)
docs/content/reference/sdk-reference/python/tools.mdx
+50
@@ -49,6 +49,56 @@ def get_raw_composio_tools(tools: list[str | None] = ..., search: str | None = .
49
50 ---
51
52 +### get_raw_tool_router_meta_tools()
53 +
54 +Fetches the meta tools for a tool router session. This method fetches the meta tools from the Composio API and transforms them to the expected format. It provides access to the underlying meta tool data without provider-specific wrapping.
55 +
56 +```python
57 +def get_raw_tool_router_meta_tools(session_id: str, modifiers: 'Modifiers' | None = ...) -> list[Tool]
58 +```
59 +
60 +**Parameters**
61 +
62 +| Name | Type |
63 +|------|------|
64 +| `session_id` | `str` |
65 +| `modifiers?` | `'Modifiers' \| None` |
66 +
67 +**Returns**
68 +
69 +`list[Tool]` — The list of meta tools
70 +
71 +**Example**
72 +
73 +```python
74 +```python
75 + from composio import Composio
76 +
77 + composio = Composio()
78 + tools_model = composio.tools
79 +
80 + # Get meta tools for a session
81 + meta_tools = tools_model.get_raw_tool_router_meta_tools("session_123")
82 + print(meta_tools)
83 +
84 + # Get meta tools with schema modifiers
85 + from composio.core.models import schema_modifier
86 +
87 + @schema_modifier
88 + def modify_schema(tool: str, toolkit: str, schema):
89 + # Customize the schema
90 + schema.description = f"Modified: {schema.description}"
91 + return schema
92 +
93 + meta_tools = tools_model.get_raw_tool_router_meta_tools(
94 + "session_123",
95 + modifiers=[modify_schema]
96 + )
97 + ```
98 +```
99 +
100 +---
101 +
102 ### get()
103
104 Get a tool or list of tools based on the provided arguments.
docs/content/reference/sdk-reference/python/triggers.mdx
+13 -8
@@ -110,24 +110,26 @@ def subscribe(timeout: float = ...) -> TriggerSubscription
110
111 ### verify_webhook()
112
113 -Verify an incoming webhook payload and signature. This method validates that the webhook request is authentic by: 1. Verifying the HMAC-SHA256 signature matches the payload 2. Optionally checking that the webhook timestamp is within the tolerance window
113 +Verify an incoming webhook payload and signature. This method validates that the webhook request is authentic by: 1. Validating the webhook timestamp is within the tolerance window 2. Verifying the HMAC-SHA256 signature using the correct algorithm 3. Parsing the payload and detecting the webhook version (V1, V2, or V3)
114
115 ```python
116 -def verify_webhook(payload: str, signature: str, secret: str, tolerance: int = ...) -> TriggerEvent
116 +def verify_webhook(id: str, payload: str, secret: str, signature: str, timestamp: str, tolerance: int = ...) -> VerifyWebhookResult
117 ```
118
119 **Parameters**
120
121 | Name | Type |
122 |------|------|
123 +| `id` | `str` |
124 | `payload` | `str` |
124 -| `signature` | `str` |
125 | `secret` | `str` |
126 +| `signature` | `str` |
127 +| `timestamp` | `str` |
128 | `tolerance?` | `int` |
129
130 **Returns**
131
130 -`TriggerEvent` — The verified and parsed webhook payload as a TriggerEvent :raises WebhookSignatureVerificationError: If the signature verification fails :raises WebhookPayloadError: If the payload cannot be parsed or is invalid
132 +`VerifyWebhookResult` — VerifyWebhookResult containing version, normalized payload, and raw payload :raises WebhookSignatureVerificationError: If the signature verification fails :raises WebhookPayloadError: If the payload cannot be parsed or is invalid
133
134 **Example**
135
@@ -136,14 +138,17 @@ def verify_webhook(payload: str, signature: str, secret: str, tolerance: int = .
138 @app.route('/webhook', methods=['POST'])
139 def webhook():
140 try:
139 - event = composio.triggers.verify_webhook(
141 + result = composio.triggers.verify_webhook(
142 + id=request.headers.get('webhook-id', ''),
143 payload=request.get_data(as_text=True),
141 - signature=request.headers.get('x-composio-signature', ''),
144 + signature=request.headers.get('webhook-signature', ''),
145 + timestamp=request.headers.get('webhook-timestamp', ''),
146 secret=os.environ['COMPOSIO_WEBHOOK_SECRET'],
147 )
148
149 # Process the verified payload
146 - print(f"Received trigger: {event['trigger_slug']}")
150 + print(f"Version: {result['version']}")
151 + print(f"Received trigger: {result['payload']['trigger_slug']}")
152 return 'OK', 200
153 except WebhookSignatureVerificationError:
154 return 'Unauthorized', 401
@@ -151,4 +156,4 @@ def verify_webhook(payload: str, signature: str, secret: str, tolerance: int = .
156
157 ---
158
154 -[View source](https://github.com/composiohq/composio/blob/next/python/composio/core/models/triggers.py#L629)
159 +[View source](https://github.com/composiohq/composio/blob/next/python/composio/core/models/triggers.py#L689)