|
12 | 12 | This is the primary method used when integrating with OpenAI, LangChain, or CrewAI. |
13 | 13 | The internal flow is: |
14 | 14 |
|
15 | | -1. Fetch tools from linked accounts via MCP to discover available connectors |
| 15 | +1. Fetch tools from linked accounts via MCP (provides connectors and tool schemas) |
16 | 16 | 2. Search EACH connector in parallel via the semantic search API (/actions/search) |
17 | | -3. The search API returns results with full ``input_schema`` for each action |
18 | | -4. Build executable tools directly from search results (no match-back needed) |
19 | | -5. Deduplicate by action_id, sort by relevance score, apply top_k |
20 | | -6. Return Tools sorted by relevance score |
| 17 | +3. Match search results to MCP tool definitions |
| 18 | +4. Deduplicate, sort by relevance score, apply top_k |
| 19 | +5. Return Tools sorted by relevance score |
21 | 20 |
|
22 | 21 | Key point: only the user's own connectors are searched — no wasted results |
23 | | -from connectors the user doesn't have. The search API returns ``input_schema`` |
24 | | -with each result, so tools can be built directly without a separate fetch. |
| 22 | +from connectors the user doesn't have. Tool schemas come from MCP (source |
| 23 | +of truth), while the search API provides relevance ranking. |
25 | 24 |
|
26 | 25 | If the semantic API is unavailable, the SDK falls back to a local |
27 | 26 | BM25 + TF-IDF hybrid search over the fetched tools (unless |
|
31 | 30 | 2. ``search_action_names(query)`` — Lightweight discovery |
32 | 31 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
33 | 32 |
|
34 | | -Queries the semantic API directly and returns action metadata |
35 | | -(action_id, connector, score, description, input_schema) **without** |
36 | | -building full tool objects. Useful for previewing results before |
37 | | -committing to a full fetch. |
| 33 | +Queries the semantic API directly and returns action IDs with |
| 34 | +similarity scores, **without** building full tool objects. Useful |
| 35 | +for previewing results before committing to a full fetch. |
38 | 36 |
|
39 | 37 | When ``account_ids`` are provided, each connector is searched in |
40 | 38 | parallel (same as ``search_tools``). Without ``account_ids``, results |
|
0 commit comments