Skip to content

Commit 692df11

Browse files
DidierRLopesminhhoang1023claude
authored
Add listed_apps_in_marketplace MCP tool (#6)
* listed apps mcp tool * Improve listed_apps_in_marketplace tool for LLM discoverability - Rewrite docstring with explicit trigger phrases (e.g. "any data on crypto/options/...") and clarify that OpenBB data comes from vendor apps, so the LLM reliably picks this tool for data-availability questions. - Slim output to fields that help the LLM match user topics and cite a source: drop backendUrl, thumbnail, screenshots, contactEmail, apiKeyUrl, version, isBuiltIn, isDevelopment, averageRating. Keep widgets (full list — essential for keyword matching), vendor description, auth type, and documentation URL. - Filter out E2E test apps and isDevelopment=True apps. - Add 10s timeout on the HTTP call. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Minh Hoang <nminh.hoang1023@gmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8e20862 commit 692df11

1 file changed

Lines changed: 74 additions & 0 deletions

File tree

server.py

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,80 @@ def _find_section_content(full_docs: str, title: str) -> Optional[str]:
425425
return None
426426

427427

428+
@mcp.tool()
429+
def listed_apps_in_marketplace() -> str:
430+
"""Search the OpenBB Marketplace for apps, datasets, and data vendors.
431+
432+
OpenBB Workspace does NOT ship its own datasets — data is provided by
433+
third-party vendor apps published to the OpenBB Marketplace. Use this
434+
tool whenever a user asks about data availability, coverage, vendors,
435+
workflows, or apps for a specific asset class or domain.
436+
437+
Call this tool for questions like:
438+
- "Do you have any data from the marketplace about crypto?"
439+
- "What options data is available?"
440+
- "Is there anything on institutional flow / futures / ETFs / macro?"
441+
- "Which vendors offer fundamentals data?"
442+
- "Any app for <topic>?"
443+
- "What workflows / dashboards are available in OpenBB?"
444+
- "Who provides <dataset>?"
445+
446+
Returns a markdown catalog of every published app with: app name,
447+
vendor, description, the list of widgets (data views) the app exposes,
448+
prompts, auth type, and documentation link. Search the widget names
449+
and descriptions in the returned text to match the user's topic,
450+
then recommend the relevant apps and vendors with their documentation
451+
link.
452+
"""
453+
454+
try:
455+
response = httpx.get(
456+
"https://payments.openbb.dev/marketplace/apps", timeout=10.0
457+
)
458+
response.raise_for_status()
459+
apps = response.json()
460+
461+
apps = [
462+
a for a in apps
463+
if not a.get("appName", "").startswith("E2E")
464+
and not a.get("isDevelopment", False)
465+
]
466+
467+
result_lines = [f"# OpenBB Marketplace Apps ({len(apps)} apps available)\n"]
468+
469+
for app_item in apps:
470+
result_lines.append(f"## {app_item.get('appName', 'N/A')}")
471+
result_lines.append(f"- **Vendor:** {app_item.get('vendorName', 'N/A')}")
472+
result_lines.append(f"- **Description:** {app_item.get('description', 'N/A')}")
473+
474+
if app_item.get("vendorDescription"):
475+
result_lines.append(f"- **About the vendor:** {app_item['vendorDescription']}")
476+
477+
result_lines.append(f"- **Auth Type:** {app_item.get('authType', [])}")
478+
479+
if app_item.get("documentationUrl"):
480+
result_lines.append(f"- **Documentation:** {app_item['documentationUrl']}")
481+
482+
widgets = app_item.get("widgets", [])
483+
if widgets:
484+
result_lines.append(
485+
f"- **Widgets ({len(widgets)}):** {', '.join(str(w) for w in widgets)}"
486+
)
487+
488+
prompts = app_item.get("prompts", [])
489+
if prompts:
490+
result_lines.append(
491+
f"- **Prompts ({len(prompts)}):** {', '.join(str(p) for p in prompts)}"
492+
)
493+
494+
result_lines.append("")
495+
496+
return "\n".join(result_lines)
497+
498+
except httpx.HTTPError as e:
499+
return f"Error fetching marketplace apps: {str(e)}"
500+
501+
428502
if __name__ == "__main__":
429503
# Use PORT environment variable
430504
port = int(os.environ.get("PORT", 8000))

0 commit comments

Comments
 (0)