"""Pydantic schemas for MCP server tools.
This module defines the data models for tool inputs and outputs.
"""
from pydantic import BaseModel, Field
class Source(BaseModel):
"""A source document with citation information."""
doc_id: str = Field(..., description="Document identifier (filename)")
snippet: str = Field(..., description="Short text excerpt from the document")
score: float = Field(..., description="Similarity score (0..1)")
class AnswerWithCitations(BaseModel):
"""Answer to a query with supporting sources."""
answer: str = Field(..., description="Synthesized answer (<=120 words)")
sources: list[Source] = Field(..., description="1-5 supporting sources")
class TextProfile(BaseModel):
"""Text analytics profile for a document or passage."""
char_count: int = Field(..., description="Total character count")
token_count: int = Field(..., description="Total word/token count")
type_token_ratio: float = Field(..., description="Lexical diversity (unique/total)")
top_ngrams: list[str] = Field(..., description="Top n-grams from the text")
readability_flesch: float = Field(..., description="Flesch Reading Ease score")
sentiment: float = Field(..., description="VADER sentiment score (-1 to 1)")
keywords: list[str] = Field(..., description="Top keywords/phrases")