Skip to main content
Glama
session.py2.01 kB
from __future__ import annotations from typing import Any, Dict, List from .datasets import DatasetLoadError, get_metadata, metadata_keys from .glossary import get_glossary_term, list_glossary_terms from .inhibitors import summarize_inhibitors DEFAULT_GLOSSARY_KEYS = ["mci", "mcii"] def _build_glossary_section() -> List[Dict[str, Any]]: entries: List[Dict[str, Any]] = [] for key in DEFAULT_GLOSSARY_KEYS: entry = get_glossary_term(key) if entry: entries.append(entry) if not entries: # Fallback to whatever glossary terms are registered. for key in list_glossary_terms(): entry = get_glossary_term(key) if entry: entries.append(entry) return entries def _build_datasets_section() -> List[Dict[str, Any]]: overview: List[Dict[str, Any]] = [] seen = set() for key in metadata_keys(): if key in seen: continue meta = get_metadata(key) or {} entry = { "key": key, "title": meta.get("title") or meta.get("description"), "path": meta.get("file_name") or meta.get("path") or key, "notes": (meta.get("notes") or [])[:2], "license": meta.get("license"), } overview.append(entry) seen.add(key) return overview def build_session_snapshot() -> Dict[str, Any]: try: inhibitors_summary = summarize_inhibitors() except DatasetLoadError as exc: inhibitors_summary = {"error": str(exc)} return { "instructions": [ "Use glossary definitions to interpret abbreviations like MCI/MCIi.", "Call list_inhibitors or summarize_inhibitors for counts before deeper analysis.", "Use get_inhibitor_sources(compound=...) to retrieve supporting PubMed IDs.", ], "glossary": _build_glossary_section(), "datasets": _build_datasets_section(), "inhibitors_summary": inhibitors_summary, }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ndaniel/aurora-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server