Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheEntry ¶
type CacheEntry struct {
ViewName string `json:"view_name"`
Dataset string `json:"dataset"`
Schema string `json:"schema"`
Files []CacheFileInfo `json:"files"`
TotalSize int64 `json:"total_size_bytes"`
}
CacheEntry describes a cached dataset/schema in the cache directory.
type CacheFileInfo ¶
type CacheFileInfo struct {
Filename string `json:"filename"`
Symbols []string `json:"symbols,omitempty"`
StypeIn string `json:"stype_in,omitempty"`
StypeOut string `json:"stype_out,omitempty"`
Start string `json:"start,omitempty"`
End string `json:"end,omitempty"`
FetchedAt string `json:"fetched_at,omitempty"`
RecordCount int64 `json:"record_count,omitempty"`
Cost float64 `json:"cost,omitempty"`
SizeBytes int64 `json:"size_bytes"`
}
CacheFileInfo describes a single cached parquet file and its manifest metadata.
type CacheManifest ¶
type CacheManifest struct {
Symbols []string `json:"symbols"`
StypeIn string `json:"stype_in"`
StypeOut string `json:"stype_out"`
Start string `json:"start"`
End string `json:"end"`
FetchedAt string `json:"fetched_at"`
RecordCount int64 `json:"record_count"`
Cost float64 `json:"cost"`
}
CacheManifest is the sidecar JSON manifest written alongside each cached parquet file.
type Server ¶
Server holds state for MCP data tool handlers. It embeds *mcp_meta.Server for access to MaxCost and Logger.
func NewServer ¶
func NewServer(config ServerConfig, logger *slog.Logger) *Server
NewServer creates a new Server with the given API key, and logger.
func (*Server) GetCacheDB ¶
func (*Server) GetCacheDir ¶
func (*Server) GetMaxCost ¶
func (*Server) InitCache ¶
InitCache opens an in-memory DuckDB database and creates views for any existing cached parquet files.
func (*Server) RegisterDataTools ¶
func (s *Server) RegisterDataTools(mcpServer *mcp_server.MCPServer)
RegisterDataTools registers data-specific MCP tools (fetch_range + cache tools). When ReadOnly is true, fetch_range is not registered, preventing any billing.
type ServerConfig ¶
type ServerConfig struct {
ApiKey string // Databento API key
MaxCost float64 // Max cost for a query
CacheDir string // Directory for cached data files
CacheDB string // Path to DuckDB database file (reserved for future use)
ReadOnly bool // When true, fetch_range is disabled (no billing possible)
}