universal-mcp-agents 0.1.23__py3-none-any.whl → 0.1.24rc3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. universal_mcp/agents/__init__.py +11 -2
  2. universal_mcp/agents/base.py +3 -6
  3. universal_mcp/agents/codeact0/agent.py +14 -17
  4. universal_mcp/agents/codeact0/prompts.py +9 -3
  5. universal_mcp/agents/codeact0/sandbox.py +2 -2
  6. universal_mcp/agents/codeact0/tools.py +2 -2
  7. universal_mcp/agents/codeact0/utils.py +48 -0
  8. universal_mcp/agents/codeact00/__init__.py +3 -0
  9. universal_mcp/agents/codeact00/__main__.py +26 -0
  10. universal_mcp/agents/codeact00/agent.py +578 -0
  11. universal_mcp/agents/codeact00/config.py +77 -0
  12. universal_mcp/agents/codeact00/langgraph_agent.py +14 -0
  13. universal_mcp/agents/codeact00/llm_tool.py +25 -0
  14. universal_mcp/agents/codeact00/prompts.py +364 -0
  15. universal_mcp/agents/codeact00/sandbox.py +135 -0
  16. universal_mcp/agents/codeact00/state.py +66 -0
  17. universal_mcp/agents/codeact00/tools.py +525 -0
  18. universal_mcp/agents/codeact00/utils.py +678 -0
  19. universal_mcp/agents/codeact01/__init__.py +3 -0
  20. universal_mcp/agents/codeact01/__main__.py +26 -0
  21. universal_mcp/agents/codeact01/agent.py +413 -0
  22. universal_mcp/agents/codeact01/config.py +77 -0
  23. universal_mcp/agents/codeact01/langgraph_agent.py +14 -0
  24. universal_mcp/agents/codeact01/llm_tool.py +25 -0
  25. universal_mcp/agents/codeact01/prompts.py +246 -0
  26. universal_mcp/agents/codeact01/sandbox.py +162 -0
  27. universal_mcp/agents/codeact01/state.py +58 -0
  28. universal_mcp/agents/codeact01/tools.py +648 -0
  29. universal_mcp/agents/codeact01/utils.py +552 -0
  30. universal_mcp/agents/llm.py +7 -3
  31. universal_mcp/applications/llm/app.py +66 -15
  32. {universal_mcp_agents-0.1.23.dist-info → universal_mcp_agents-0.1.24rc3.dist-info}/METADATA +1 -1
  33. universal_mcp_agents-0.1.24rc3.dist-info/RECORD +66 -0
  34. universal_mcp_agents-0.1.23.dist-info/RECORD +0 -44
  35. {universal_mcp_agents-0.1.23.dist-info → universal_mcp_agents-0.1.24rc3.dist-info}/WHEEL +0 -0
@@ -0,0 +1,525 @@
1
+ import asyncio
2
+ import base64
3
+ from collections import defaultdict
4
+ from pathlib import Path
5
+ from typing import Annotated, Any
6
+
7
+ from langchain_core.tools import tool
8
+ from pydantic import Field
9
+ from universal_mcp.agentr.client import AgentrClient
10
+ from universal_mcp.agentr.registry import AgentrRegistry
11
+ from universal_mcp.applications.markitdown.app import MarkitdownApp
12
+ from universal_mcp.types import ToolFormat
13
+
14
+ from universal_mcp.agents.codeact00.prompts import build_tool_definitions
15
+
16
+
17
+ def enter_agent_builder_mode():
18
+ """Call this function to enter agent builder mode. Agent builder mode is when the user wants to store a repeated task as a script with some inputs for the future."""
19
+ return
20
+
21
+
22
+ @tool
23
+ def finalize_planning() -> str:
24
+ """Finalize planning when clarifications are complete and you're ready to produce the structured plan."""
25
+ return "planning_finalized"
26
+
27
+ @tool
28
+ def cancel_planning() -> str:
29
+ """Exit agent builder mode and return to the main agent without creating or updating a plan."""
30
+ return "exit"
31
+
32
+
33
+ def create_meta_tools(tool_registry: AgentrRegistry) -> dict[str, Any]:
34
+ """Create the meta tools for searching and loading tools"""
35
+
36
+ @tool
37
+ async def search_functions(
38
+ queries: Annotated[
39
+ list[list[str]] | None,
40
+ Field(
41
+ description="A list of query lists. Each inner list contains one or more search terms that will be used together to find relevant tools."
42
+ ),
43
+ ] = None,
44
+ app_ids: Annotated[
45
+ list[str] | None,
46
+ Field(description="The ID or list of IDs (common names) of specific applications to search within."),
47
+ ] = None,
48
+ ) -> str:
49
+ """
50
+ Searches for relevant functions based on queries and/or applications. This function
51
+ operates in three powerful modes with support for multi-query searches:
52
+
53
+ 1. **Global Search** (`queries` only as List[List[str]]):
54
+ - Searches all functions across all applications.
55
+ - Supports multiple independent searches in parallel.
56
+ - Each inner list represents a separate search query.
57
+
58
+ Examples:
59
+ - Single global search:
60
+ `search_functions(queries=[["create presentation"]])`
61
+
62
+ - Multiple independent global searches:
63
+ `search_functions(queries=[["send email"], ["schedule meeting"]])`
64
+
65
+ - Multi-term search for comprehensive results:
66
+ `search_functions(queries=[["send email", "draft email", "compose email"]])`
67
+
68
+ 2. **App Discovery** (`app_ids` only as List[str]):
69
+ - Returns ALL available functions for one or more specific applications.
70
+ - Use this to explore the complete capability set of an application.
71
+
72
+ Examples:
73
+ - Single app discovery:
74
+ `search_functions(app_ids=["Gmail"])`
75
+
76
+ - Multiple app discovery:
77
+ `search_functions(app_ids=["Gmail", "Google Calendar", "Slack"])`
78
+
79
+ 3. **Scoped Search** (`queries` as List[List[str]] and `app_ids` as List[str]):
80
+ - Performs targeted searches within specific applications in parallel.
81
+ - The number of app_ids must match the number of inner query lists.
82
+ - Each query list is searched within its corresponding app_id.
83
+ - Supports multiple search terms per app for comprehensive discovery.
84
+
85
+ Examples:
86
+ - Basic scoped search (one query per app):
87
+ `search_functions(queries=[["find email"], ["share file"]], app_ids=["Gmail", "Google_Drive"])`
88
+
89
+ - Multi-term scoped search (multiple queries per app):
90
+ `search_functions(
91
+ queries=[
92
+ ["send email", "draft email", "compose email", "reply to email"],
93
+ ["create event", "schedule meeting", "find free time"],
94
+ ["upload file", "share file", "create folder", "search files"]
95
+ ],
96
+ app_ids=["Gmail", "Google Calendar", "Google_Drive"]
97
+ )`
98
+
99
+ - Mixed complexity (some apps with single query, others with multiple):
100
+ `search_functions(
101
+ queries=[
102
+ ["list messages"],
103
+ ["create event", "delete event", "update event"]
104
+ ],
105
+ app_ids=["Gmail", "Google Calendar"]
106
+ )`
107
+
108
+ **Pro Tips:**
109
+ - Use multiple search terms in a single query list to cast a wider net and discover related functionality
110
+ - Multi-term searches are more efficient than separate calls
111
+ - Scoped searches return more focused results than global searches
112
+ - The function returns connection status for each app (connected vs NOT connected)
113
+ - All searches within a single call execute in parallel for maximum efficiency
114
+
115
+ **Parameters:**
116
+ - `queries` (List[List[str]], optional): A list of query lists. Each inner list contains one or more
117
+ search terms that will be used together to find relevant tools.
118
+ - `app_ids` (List[str], optional): A list of application IDs to search within or discover.
119
+
120
+ **Returns:**
121
+ - A structured response containing:
122
+ - Matched tools with their descriptions
123
+ - Connection status for each app
124
+ - Recommendations for which tools to load next
125
+ """
126
+ registry = tool_registry
127
+
128
+ TOOL_THRESHOLD = 0.75
129
+ APP_THRESHOLD = 0.7
130
+
131
+ # --- Helper Functions for Different Search Modes ---
132
+
133
+ async def _handle_global_search(queries: list[str]) -> list[list[dict[str, Any]]]:
134
+ """Performs a broad search across all apps to find relevant tools and apps."""
135
+ # 1. Perform initial broad searches for tools and apps concurrently.
136
+ initial_tool_tasks = [registry.search_tools(query=q, distance_threshold=TOOL_THRESHOLD) for q in queries]
137
+ app_search_tasks = [registry.search_apps(query=q, distance_threshold=APP_THRESHOLD) for q in queries]
138
+
139
+ initial_tool_results, app_search_results = await asyncio.gather(
140
+ asyncio.gather(*initial_tool_tasks), asyncio.gather(*app_search_tasks)
141
+ )
142
+
143
+ # 2. Create a prioritized list of app IDs for the final search.
144
+ app_ids_from_apps = {app["id"] for result_list in app_search_results for app in result_list}
145
+ prioritized_app_id_list = list(app_ids_from_apps)
146
+
147
+ app_ids_from_tools = {tool["app_id"] for result_list in initial_tool_results for tool in result_list}
148
+ for tool_app_id in app_ids_from_tools:
149
+ if tool_app_id not in app_ids_from_apps:
150
+ prioritized_app_id_list.append(tool_app_id)
151
+
152
+ if not prioritized_app_id_list:
153
+ return []
154
+
155
+ # 3. Perform the final, comprehensive tool search across the prioritized apps.
156
+ final_tool_search_tasks = [
157
+ registry.search_tools(query=query, app_id=app_id_to_search, distance_threshold=TOOL_THRESHOLD)
158
+ for app_id_to_search in prioritized_app_id_list
159
+ for query in queries
160
+ ]
161
+ return await asyncio.gather(*final_tool_search_tasks)
162
+
163
+ async def _handle_scoped_search(app_ids: list[str], queries: list[list[str]]) -> list[list[dict[str, Any]]]:
164
+ """Performs targeted searches for specific queries within specific applications."""
165
+ if len(app_ids) != len(queries):
166
+ raise ValueError("The number of app_ids must match the number of query lists.")
167
+
168
+ tasks = []
169
+ for app_id, query_list in zip(app_ids, queries):
170
+ for query in query_list:
171
+ # Create a search task for each query in the list for the corresponding app
172
+ tasks.append(registry.search_tools(query=query, app_id=app_id, distance_threshold=TOOL_THRESHOLD))
173
+
174
+ return await asyncio.gather(*tasks)
175
+
176
+ async def _handle_app_discovery(app_ids: list[str]) -> list[list[dict[str, Any]]]:
177
+ """Fetches all tools for a list of applications."""
178
+ tasks = [registry.search_tools(query="", app_id=app_id, limit=20) for app_id in app_ids]
179
+ return await asyncio.gather(*tasks)
180
+
181
+ # --- Helper Functions for Structuring and Formatting Results ---
182
+
183
+ def _format_response(structured_results: list[dict[str, Any]]) -> str:
184
+ """Builds the final, user-facing formatted string response from structured data."""
185
+ if not structured_results:
186
+ return "No relevant functions were found."
187
+
188
+ result_parts = []
189
+ apps_in_results = {app["app_id"] for app in structured_results}
190
+ connected_apps_in_results = {
191
+ app["app_id"] for app in structured_results if app["connection_status"] == "connected"
192
+ }
193
+
194
+ for app in structured_results:
195
+ app_id = app["app_id"]
196
+ app_status = "connected" if app["connection_status"] == "connected" else "NOT connected"
197
+ result_parts.append(f"Tools from {app_id} (status: {app_status} by user):")
198
+
199
+ for tool in app["tools"]:
200
+ result_parts.append(f" - {tool['id']}: {tool['description']}")
201
+ result_parts.append("") # Empty line for readability
202
+
203
+ # Add summary connection status messages
204
+ if not connected_apps_in_results and len(apps_in_results) > 1:
205
+ result_parts.append(
206
+ "Connection Status: None of the apps in the results are connected. "
207
+ "You must ask the user to choose the application."
208
+ )
209
+ elif len(connected_apps_in_results) > 1:
210
+ connected_list = ", ".join(sorted(list(connected_apps_in_results)))
211
+ result_parts.append(
212
+ f"Connection Status: Multiple apps are connected ({connected_list}). "
213
+ "You must ask the user to select which application they want to use."
214
+ )
215
+
216
+ result_parts.append("Call load_functions to select the required functions only.")
217
+ if 0 <= len(connected_apps_in_results) < len(apps_in_results):
218
+ result_parts.append(
219
+ "Unconnected app functions can also be loaded if asked for by the user, they will generate a connection link"
220
+ "but prefer connected ones. Ask the user to choose the app if none of the "
221
+ "relevant apps are connected."
222
+ )
223
+
224
+ return "\n".join(result_parts)
225
+
226
+ def _structure_tool_results(
227
+ raw_tool_lists: list[list[dict[str, Any]]], connected_app_ids: set[str]
228
+ ) -> list[dict[str, Any]]:
229
+ """
230
+ Converts raw search results into a structured format, handling duplicates,
231
+ cleaning descriptions, and adding connection status.
232
+ """
233
+ aggregated_tools = defaultdict(dict)
234
+ # Use a list to maintain the order of apps as they are found.
235
+ ordered_app_ids = []
236
+
237
+ for tool_list in raw_tool_lists:
238
+ for tool in tool_list:
239
+ app_id = tool.get("app_id", "unknown")
240
+ tool_id = tool.get("id")
241
+
242
+ if not tool_id:
243
+ continue
244
+
245
+ if app_id not in aggregated_tools:
246
+ ordered_app_ids.append(app_id)
247
+
248
+ if tool_id not in aggregated_tools[app_id]:
249
+ aggregated_tools[app_id][tool_id] = {
250
+ "id": tool_id,
251
+ "description": _clean_tool_description(tool.get("description", "")),
252
+ }
253
+
254
+ # Build the final results list respecting the discovery order.
255
+ found_tools_result = []
256
+ for app_id in ordered_app_ids:
257
+ if app_id in aggregated_tools and aggregated_tools[app_id]:
258
+ found_tools_result.append(
259
+ {
260
+ "app_id": app_id,
261
+ "connection_status": "connected" if app_id in connected_app_ids else "not_connected",
262
+ "tools": list(aggregated_tools[app_id].values()),
263
+ }
264
+ )
265
+ return found_tools_result
266
+
267
+ def _clean_tool_description(description: str) -> str:
268
+ """Consistently formats tool descriptions by removing implementation details."""
269
+ return description.split("Context:")[0].strip()
270
+
271
+ # Main Function Logic
272
+
273
+ if not queries and not app_ids:
274
+ raise ValueError("You must provide 'queries', 'app_ids', or both.")
275
+
276
+ # --- Initialization and Input Normalization ---
277
+ connections = await registry.list_connected_apps()
278
+ connected_app_ids = {connection["app_id"] for connection in connections}
279
+
280
+ canonical_app_ids = []
281
+ if app_ids:
282
+ # Concurrently search for all provided app names
283
+ app_search_tasks = [
284
+ registry.search_apps(query=app_name, distance_threshold=APP_THRESHOLD) for app_name in app_ids
285
+ ]
286
+ app_search_results = await asyncio.gather(*app_search_tasks)
287
+
288
+ # Process results and build the list of canonical IDs, handling not found errors
289
+ for app_name, result_list in zip(app_ids, app_search_results):
290
+ if not result_list:
291
+ raise ValueError(f"Application '{app_name}' could not be found.")
292
+ # Assume the first result is the correct one
293
+ canonical_app_ids.append(result_list[0]["id"])
294
+
295
+ # --- Mode Dispatching ---
296
+ raw_results = []
297
+
298
+ if canonical_app_ids and queries:
299
+ raw_results = await _handle_scoped_search(canonical_app_ids, queries)
300
+ elif canonical_app_ids:
301
+ raw_results = await _handle_app_discovery(canonical_app_ids)
302
+ elif queries:
303
+ # Flatten list of lists to list of strings for global search
304
+ flat_queries = (
305
+ [q for sublist in queries for q in sublist] if queries and not isinstance(queries[0], str) else queries
306
+ )
307
+ raw_results = await _handle_global_search(flat_queries)
308
+
309
+ # --- Structuring and Formatting ---
310
+ structured_data = _structure_tool_results(raw_results, connected_app_ids)
311
+ return _format_response(structured_data)
312
+
313
+ @tool
314
+ async def load_functions(tool_ids: list[str]) -> str:
315
+ """
316
+ Loads specified functions and returns their Python signatures and docstrings.
317
+ This makes the functions available for use inside the 'execute_ipython_cell' tool.
318
+ The agent MUST use the returned information to understand how to call the functions correctly.
319
+
320
+ Args:
321
+ tool_ids: A list of function IDs in the format 'app__function'. Example: ['google_mail__send_email']
322
+
323
+ Returns:
324
+ A string containing the signatures and docstrings of the successfully loaded functions,
325
+ ready for the agent to use in its code.
326
+ """
327
+ if not tool_ids:
328
+ return "No tool IDs provided to load."
329
+
330
+ # Step 1: Validate which tools are usable and get login links for others.
331
+ valid_tools, unconnected_links = await get_valid_tools(tool_ids=tool_ids, registry=tool_registry)
332
+
333
+ if not valid_tools:
334
+ response_string = "Error: None of the provided tool IDs could be validated or loaded."
335
+ return response_string, {}, [], ""
336
+
337
+ # Step 2: Export the schemas of the valid tools.
338
+ await tool_registry.load_tools(valid_tools)
339
+ exported_tools = await tool_registry.export_tools(
340
+ valid_tools, ToolFormat.NATIVE
341
+ ) # Get definition for only the new tools
342
+
343
+ # Step 3: Build the informational string for the agent.
344
+ tool_definitions, new_tools_context = build_tool_definitions(exported_tools)
345
+
346
+ result_parts = [
347
+ f"Successfully loaded {len(exported_tools)} functions. They are now available for use inside `execute_ipython_cell`:",
348
+ "\n".join(tool_definitions),
349
+ ]
350
+
351
+ response_string = "\n\n".join(result_parts)
352
+ unconnected_links = "\n".join(unconnected_links)
353
+
354
+ return response_string, new_tools_context, valid_tools, unconnected_links
355
+
356
+ async def web_search(query: str) -> dict:
357
+ """
358
+ Get an LLM answer to a question informed by Exa search results. Useful when you need information from a wide range of real-time sources on the web. Do not use this when you need to access contents of a specific webpage.
359
+
360
+ This tool performs an Exa `/answer` request, which:
361
+ 1. Provides a **direct answer** for factual queries (e.g., "What is the capital of France?" → "Paris")
362
+ 2. Generates a **summary with citations** for open-ended questions
363
+ (e.g., "What is the state of AI in healthcare?" → A detailed summary with source links)
364
+
365
+ Args:
366
+ query (str): The question or topic to answer.
367
+ Returns:
368
+ dict: A structured response containing only:
369
+ - answer (str): Generated answer
370
+ - citations (list[dict]): List of cited sources
371
+ """
372
+ await tool_registry.export_tools(["exa__answer"], ToolFormat.LANGCHAIN)
373
+ response = await tool_registry.call_tool("exa__answer", {"query": query, "text": True})
374
+
375
+ # Extract only desired fields
376
+ return {
377
+ "answer": response.get("answer"),
378
+ "citations": response.get("citations", []),
379
+ }
380
+
381
+ async def read_file(uri: str) -> str:
382
+ """
383
+ Asynchronously reads a local file or uri and returns the content as a markdown string.
384
+
385
+ This tool aims to extract the main text content from various sources.
386
+ It automatically prepends 'file://' to the input string if it appears
387
+ to be a local path without a specified scheme (like http, https, data, file).
388
+
389
+ Args:
390
+ uri (str): The URI pointing to the resource or a local file path.
391
+ Supported schemes:
392
+ - http:// or https:// (Web pages, feeds, APIs)
393
+ - file:// (Local or accessible network files)
394
+ - data: (Embedded data)
395
+
396
+ Returns:
397
+ A string containing the markdown representation of the content at the specified URI
398
+
399
+ Raises:
400
+ ValueError: If the URI is invalid, empty, or uses an unsupported scheme
401
+ after automatic prefixing.
402
+
403
+ Tags:
404
+ convert, markdown, async, uri, transform, document, important
405
+ """
406
+ markitdown = MarkitdownApp()
407
+ response = await markitdown.convert_to_markdown(uri)
408
+ return response
409
+
410
+ def save_file(file_name: str, content: str) -> dict:
411
+ """
412
+ Saves a file to the local filesystem.
413
+
414
+ Args:
415
+ file_name (str): The name of the file to save.
416
+ content (str): The content to save to the file.
417
+
418
+ Returns:
419
+ dict: A dictionary containing the result of the save operation with the following fields:
420
+ - status (str): "success" if the save succeeded, "error" otherwise.
421
+ - message (str): A message returned by the server, typically indicating success or providing error details.
422
+ """
423
+ with Path(file_name).open("w") as f:
424
+ f.write(content)
425
+
426
+ return {
427
+ "status": "success",
428
+ "message": f"File {file_name} saved successfully",
429
+ "file_path": Path(file_name).absolute(),
430
+ }
431
+
432
+ def upload_file(file_name: str, mime_type: str, base64_data: str) -> dict:
433
+ """
434
+ Uploads a file to the server.
435
+
436
+ Args:
437
+ file_name (str): The name of the file to upload.
438
+ mime_type (str): The MIME type of the file.
439
+ base64_data (str): The file content encoded as a base64 string.
440
+
441
+ Returns:
442
+ dict: A dictionary containing the result of the upload operation with the following fields:
443
+ - status (str): "success" if the upload succeeded, "error" otherwise.
444
+ - message (str): A message returned by the server, typically indicating success or providing error details.
445
+ - signed_url (str or None): The signed URL to access the uploaded file if successful, None otherwise.
446
+ """
447
+ client: AgentrClient = tool_registry.client
448
+ bytes_data = base64.b64decode(base64_data)
449
+ response = client._upload_file(file_name, mime_type, bytes_data)
450
+ if response.get("status") != "success":
451
+ return {
452
+ "status": "error",
453
+ "message": response.get("message"),
454
+ "signed_url": None,
455
+ }
456
+ return {
457
+ "status": "success",
458
+ "message": response.get("message"),
459
+ "signed_url": response.get("signed_url"),
460
+ }
461
+
462
+ return {
463
+ "search_functions": search_functions,
464
+ "load_functions": load_functions,
465
+ "web_search": web_search,
466
+ "read_file": read_file,
467
+ "upload_file": upload_file,
468
+ "save_file": save_file,
469
+ }
470
+
471
+
472
+ async def get_valid_tools(tool_ids: list[str], registry: AgentrRegistry) -> tuple[list[str], list[str]]:
473
+ """For a given list of tool_ids, validates the tools and returns a list of links for the apps that have not been logged in"""
474
+ correct, incorrect = [], []
475
+ connections = await registry.list_connected_apps()
476
+ connected_apps = {connection["app_id"] for connection in connections}
477
+ unconnected = set()
478
+ unconnected_links = []
479
+ app_tool_list: dict[str, set[str]] = {}
480
+
481
+ # Group tool_ids by app for fewer registry calls
482
+ app_to_tools: dict[str, list[tuple[str, str]]] = {}
483
+ for tool_id in tool_ids:
484
+ if "__" not in tool_id:
485
+ incorrect.append(tool_id)
486
+ continue
487
+ app, tool_name = tool_id.split("__", 1)
488
+ app_to_tools.setdefault(app, []).append((tool_id, tool_name))
489
+
490
+ # Fetch all apps concurrently
491
+ async def fetch_tools(app: str):
492
+ try:
493
+ tools_dict = await registry.list_tools(app)
494
+ return app, {tool_unit["name"] for tool_unit in tools_dict}
495
+ except Exception:
496
+ return app, None
497
+
498
+ results = await asyncio.gather(*(fetch_tools(app) for app in app_to_tools))
499
+
500
+ # Build map of available tools per app
501
+ for app, tools in results:
502
+ if tools is not None:
503
+ app_tool_list[app] = tools
504
+
505
+ # Validate tool_ids
506
+ for app, tool_entries in app_to_tools.items():
507
+ available = app_tool_list.get(app)
508
+ if available is None:
509
+ incorrect.extend(tool_id for tool_id, _ in tool_entries)
510
+ continue
511
+ if app not in connected_apps and app not in unconnected:
512
+ unconnected.add(app)
513
+ text = await registry.authorise_app(app_id=app)
514
+ start = text.find(":") + 1
515
+ end = text.find(". R", start)
516
+ url = text[start:end].strip()
517
+ markdown_link = f"[Connect to {app.capitalize()}]({url})"
518
+ unconnected_links.append(markdown_link)
519
+ for tool_id, tool_name in tool_entries:
520
+ if tool_name in available:
521
+ correct.append(tool_id)
522
+ else:
523
+ incorrect.append(tool_id)
524
+
525
+ return correct, unconnected_links