Skip to main content
Glama

mcp-run-python

Official
by pydantic
fake_database.py766 B
from __future__ import annotations as _annotations from dataclasses import dataclass, field from typing import Any class FakeTable: def get(self, name: str) -> int | None: if name == 'John Doe': return 123 @dataclass class DatabaseConn: users: FakeTable = field(default_factory=FakeTable) _forecasts: dict[int, str] = field(default_factory=dict) async def execute(self, query: str) -> list[dict[str, Any]]: return [{'id': 123, 'name': 'John Doe'}] async def store_forecast(self, user_id: int, forecast: str) -> None: self._forecasts[user_id] = forecast async def get_forecast(self, user_id: int) -> str | None: return self._forecasts.get(user_id) class QueryError(RuntimeError): pass

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/pydantic/pydantic-ai'

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