Skip to main content
Glama

PyGithub MCP Server

by AstroMined
"""Response schema models. This module defines Pydantic models for MCP tool responses including text and error content types. """ from typing import List, Literal, Optional, Union from pydantic import BaseModel, Field, field_validator, ConfigDict class ToolResponse(BaseModel): """Base model for tool responses.""" model_config = ConfigDict(strict=True) content: List[dict] = Field(..., description="Response content") is_error: Optional[bool] = Field(None, description="Whether response is an error") @field_validator('content') @classmethod def validate_content(cls, v): """Validate that content list is not empty.""" if not v: raise ValueError("content list cannot be empty") return v class TextContent(BaseModel): """Text content in a tool response.""" model_config = ConfigDict(strict=True) type: Literal["text"] = "text" text: str = Field(..., description="Text content") class ErrorContent(BaseModel): """Error content in a tool response.""" model_config = ConfigDict(strict=True) type: Literal["error"] = "error" text: str = Field(..., description="Error message") # Define the union type for response content ResponseContent = Union[TextContent, ErrorContent]

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/AstroMined/pygithub-mcp-server'

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