mcp_meta

package
v0.8.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidDatasets = []string{
	"ARCX.PILLAR",
	"BATS.PITCH",
	"BATY.PITCH",
	"DBEQ.BASIC",
	"EDGA.PITCH",
	"EDGX.PITCH",
	"EPRL.DOM",
	"EQUS.MINI",
	"EQUS.SUMMARY",
	"GLBX.MDP3",
	"IEXG.TOPS",
	"IFEU.IMPACT",
	"IFLL.IMPACT",
	"IFUS.IMPACT",
	"MEMX.MEMOIR",
	"NDEX.IMPACT",
	"OPRA.PILLAR",
	"XASE.PILLAR",
	"XBOS.ITCH",
	"XCHI.PILLAR",
	"XCIS.TRADESBBO",
	"XEEE.EOBI",
	"XEUR.EOBI",
	"XNAS.BASIC",
	"XNAS.ITCH",
	"XNYS.PILLAR",
	"XPSX.ITCH",
}

ValidDatasets is the set of valid dataset codes for MCP tool enums. via: dbn-go-hist datasets

View Source
var ValidSchemas = []string{
	"mbo",
	"mbp-10",
	"mbp-1",
	"cmbp-1",
	"bbo-1s",
	"bbo-1m",
	"cbbo-1s",
	"cbbo-1m",
	"tbbo",
	"tcbbo",
	"trades",
	"ohlcv-1s",
	"ohlcv-1m",
	"ohlcv-1h",
	"ohlcv-1d",
	"definition",
	"imbalance",
	"statistics",
	"status",
}

ValidSchemas is the set of valid schema codes for MCP tool enums. via: dbn-go-hist schemas -d XNAS.ITCH

View Source
var ValidStypes = []string{
	"raw_symbol",
	"instrument_id",
	"smart",
	"continuous",
	"parent",
	"nasdaq",
	"cms",
	"isin",
	"us_code",
	"bbg_comp_id",
	"bbg_comp_ticker",
	"figi",
	"figi_ticker",
}

ValidStypes is the set of valid symbology types for MCP tool enums.

Functions

func ParseOptionalDateRange

func ParseOptionalDateRange(request mcp.CallToolRequest) (dbn_hist.DateRange, *mcp.CallToolResult)

ParseOptionalDateRange extracts optional start and end parameters into a DateRange. Returns a tool-result error if a provided value is not valid ISO 8601.

Types

type CommonParams

type CommonParams struct {
	Dataset   string
	SchemaStr string
	Symbols   []string
	StypeIn   dbn.SType
	StartStr  string
	EndStr    string
	StartTime time.Time
	EndTime   time.Time
}

CommonParams holds the parsed and validated parameters shared across tool handlers.

func ParseCommonParams

func ParseCommonParams(request mcp.CallToolRequest) (*CommonParams, *mcp.CallToolResult)

ParseCommonParams extracts and validates dataset, schema, symbol, start, and end from a tool request. Returns a tool-result error (not a Go error) so the LLM can see and reason about validation failures.

func (*CommonParams) MetadataQueryParams

func (p *CommonParams) MetadataQueryParams() dbn_hist.MetadataQueryParams

MetadataQueryParams builds a MetadataQueryParams from CommonParams.

type Server

type Server struct {
	Logger *slog.Logger
	// contains filtered or unexported fields
}

Server holds shared state for MCP metadata tool handlers.

func NewServer

func NewServer(apiKey string, logger *slog.Logger) *Server

NewServer creates a new Server with the given API key, and logger.

func (*Server) GetApiKey

func (s *Server) GetApiKey() string

GetApiKey returns the Databento API key.

func (*Server) RegisterMetaTools

func (s *Server) RegisterMetaTools(mcpServer *mcp_server.MCPServer)

RegisterMetaTools registers all metadata MCP tools (no billing) with the server.

func (*Server) RequireAPIKey

func (s *Server) RequireAPIKey() *mcp.CallToolResult

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL