Documentation
¶
Index ¶
- Constants
- func AppOnly(meta mcp.Meta) bool
- func ReadHTTPMessage(r *http.Request) (jsonrpc.Message, error)
- func RequiredToolScope(name string) string
- func WriteHTTPMessageError(w http.ResponseWriter, err error)
- type DashboardCreateInput
- type DashboardEditInput
- type DashboardIDInput
- type DashboardReplaceInput
- type DashboardRestoreInput
- type DependencyInput
- type FragmentView
- type IntelligenceSnapshots
- type LogsInput
- type Observability
- type PanelFragment
- type PanelPreview
- type PerformanceInput
- type PreviewInput
- type PreviewOutput
- type QueryInput
- type QueryTelemetryInput
- type QueryTelemetryOutput
- type SchemaInput
- type Server
- type ToolDoc
- type ToolInput
- type TraceInput
Constants ¶
const AppMIME = mcpAppMIME
const ProtocolVersion = "2026-07-28"
const UIExtension = mcpUIExtension
Variables ¶
This section is empty.
Functions ¶
func ReadHTTPMessage ¶
ReadHTTPMessage preserves the body for the SDK and excludes JSON-RPC batches.
func RequiredToolScope ¶
RequiredToolScope reports additional delegated scope needed by a tool. All remote MCP requests already require telemetry:read.
func WriteHTTPMessageError ¶
func WriteHTTPMessageError(w http.ResponseWriter, err error)
Types ¶
type DashboardCreateInput ¶
type DashboardEditInput ¶
type DashboardEditInput struct {
ID string `json:"id" jsonschema:"Dashboard ID"`
Operations []dashboard.Operation `json:"operations" jsonschema:"Edits applied in order, atomically"`
BaseVersion int `json:"base_version,omitempty" jsonschema:"Version you read; the call fails if someone saved since"`
Message string `json:"message,omitempty" jsonschema:"One line describing the change, shown in history"`
}
type DashboardIDInput ¶
type DashboardIDInput struct {
ID string `json:"id" jsonschema:"Dashboard ID returned by list_dashboards or create_dashboard"`
}
type DashboardReplaceInput ¶
type DashboardReplaceInput struct {
ID string `json:"id" jsonschema:"Dashboard ID"`
Dashboard query.Dashboard `json:"dashboard" jsonschema:"Complete replacement spec; omitted panels are removed"`
BaseVersion int `json:"base_version,omitempty" jsonschema:"Version you read; the call fails if someone saved since"`
Message string `json:"message,omitempty" jsonschema:"One line describing the change, shown in history"`
}
type DashboardRestoreInput ¶
type DependencyInput ¶
type DependencyInput struct {
Window string `json:"window,omitempty" jsonschema:"Bounded telemetry window, defaults to 1h"`
Namespace string `json:"namespace,omitempty" jsonschema:"Filter by namespace; traversal always keeps namespaces separate"`
Service string `json:"service" jsonschema:"Root service name"`
Direction string `json:"direction,omitempty" jsonschema:"upstream or downstream; defaults to downstream"`
MaxDepth int `json:"max_depth,omitempty" jsonschema:"Maximum hops from 1 to 32; defaults to 8"`
MaxNodes int `json:"max_nodes,omitempty" jsonschema:"Maximum accumulated nodes from 1 to 500 including roots; defaults to 100"`
}
type FragmentView ¶
type IntelligenceSnapshots ¶
type IntelligenceSnapshots interface {
LatestSnapshot() *intelligence.Snapshot
}
type LogsInput ¶
type LogsInput struct {
From *time.Time `json:"from,omitempty" jsonschema:"Absolute start, RFC3339Nano; requires to and excludes window"`
To *time.Time `json:"to,omitempty" jsonschema:"Absolute end, RFC3339Nano; requires from and excludes window"`
Window string `json:"window,omitempty" jsonschema:"Time window such as 15m, 1h, 24h, 168h, or 720h; defaults to 1h"`
Namespace string `json:"namespace,omitempty" jsonschema:"OpenTelemetry service namespace; empty queries all namespaces"`
Service string `json:"service,omitempty" jsonschema:"Optional exact OpenTelemetry service name"`
Severity string `json:"severity,omitempty" jsonschema:"Optional exact severity such as ERROR, WARN, or INFO"`
Search string `json:"search,omitempty" jsonschema:"Optional case-insensitive text contained in the log body, at most 200 characters"`
Limit int `json:"limit,omitempty" jsonschema:"Maximum log entries to return, from 1 to 500"`
}
type Observability ¶
type Observability interface {
Dependencies(context.Context, observability.Scope, observability.DependencyOptions) (observability.Result[observability.Dependencies], error)
Trace(context.Context, observability.Scope, string, string, int) (observability.Result[observability.TraceDetail], error)
}
type PanelFragment ¶
type PanelFragment struct {
View FragmentView `json:"view"`
Dashboard query.Dashboard `json:"dashboard"`
Results []query.Result `json:"results"`
Vars map[string]query.Value `json:"vars,omitempty"`
Trace *observability.Result[observability.TraceDetail] `json:"trace,omitempty"`
}
type PanelPreview ¶
type PanelPreview struct {
ID string `json:"id"`
Status string `json:"status" jsonschema:"ok, empty, error, invalid or not_run"`
Rows int `json:"rows,omitempty"`
Columns []string `json:"columns,omitempty"`
Sample [][]any `json:"sample,omitempty"`
Interval string `json:"interval,omitempty"`
Diagnosis string `json:"diagnosis,omitempty"`
Error string `json:"error,omitempty"`
Problems []query.Problem `json:"problems,omitempty"`
ElapsedMS *int64 `json:"elapsed_ms,omitempty" jsonschema:"Execution duration in milliseconds; omitted for invalid or not_run panels"`
}
type PerformanceInput ¶
type PerformanceInput struct {
From *time.Time `json:"from,omitempty" jsonschema:"Absolute start, RFC3339Nano; requires to and excludes window"`
To *time.Time `json:"to,omitempty" jsonschema:"Absolute end, RFC3339Nano; requires from and excludes window"`
Window string `json:"window,omitempty" jsonschema:"Time window such as 15m, 1h, 24h, 168h, or 720h; defaults to 1h"`
Namespace string `json:"namespace,omitempty" jsonschema:"OpenTelemetry service namespace; empty queries all namespaces"`
Service string `json:"service,omitempty" jsonschema:"Optional exact OpenTelemetry service name; omit for the whole system"`
Limit int `json:"limit,omitempty" jsonschema:"Maximum operations to return, from 1 to 500"`
}
type PreviewInput ¶
type PreviewInput struct {
Panels []query.Panel `json:"panels" jsonschema:"Panels to check and run, in the same format as dashboard panels"`
Variables []query.Variable `json:"variables,omitempty" jsonschema:"Variables the panels reference"`
Time *query.Time `json:"time,omitempty" jsonschema:"Time range; default the last hour"`
Vars map[string]string `json:"vars,omitempty" jsonschema:"Variable values to preview with; $__all selects All"`
}
type PreviewOutput ¶
type PreviewOutput struct {
ElapsedMS int64 `json:"elapsed_ms"`
Panels []PanelPreview `json:"panels"`
Problems []query.Problem `json:"problems,omitempty"`
}
type QueryInput ¶
type QueryInput struct {
From *time.Time `json:"from,omitempty" jsonschema:"Absolute start, RFC3339Nano; requires to and excludes window"`
To *time.Time `json:"to,omitempty" jsonschema:"Absolute end, RFC3339Nano; requires from and excludes window"`
Window string `json:"window,omitempty" jsonschema:"Time window such as 15m, 1h, 24h, 168h, or 720h; defaults to 1h"`
Namespace string `json:"namespace,omitempty" jsonschema:"OpenTelemetry service namespace; empty queries all namespaces"`
Limit int `json:"limit,omitempty" jsonschema:"Maximum services or edges to return, from 1 to 500"`
}
type QueryTelemetryInput ¶
type QueryTelemetryInput struct {
Panel query.Panel `json:"panel" jsonschema:"One v1 panel to display in the answer"`
Text string `` /* 146-byte string literal not displayed */
Variables []query.Variable `json:"variables,omitempty" jsonschema:"Optional v1 variable definitions used by this panel"`
Time *query.Time `json:"time,omitempty" jsonschema:"Optional dashboard time override: exact from/to or a relative range"`
Vars map[string]query.Value `json:"vars,omitempty" jsonschema:"Resolved variable values: strings or lists; preserves $__all and empty lists"`
}
type QueryTelemetryOutput ¶
type QueryTelemetryOutput struct {
*PanelFragment
Notices []fanql.Notice `json:"notices,omitempty"`
Error *fanql.Failure `json:"error,omitempty"`
Problems query.Problems `json:"problems,omitempty"`
}
QueryTelemetryOutput includes FanQL failures without changing preset fragments.
type SchemaInput ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewWithIntelligence ¶
func NewWithIntelligence(queries Observability, dashboards *dashboard.Service, panels *query.Executor, snapshots IntelligenceSnapshots, version string) *Server
func (*Server) HTTPHandler ¶
type ToolDoc ¶
type ToolDoc struct {
Name string
Title string
Description string
AppOnly bool
ResourceURI string
// ReadOnly is the server's own readOnlyHint.
ReadOnly bool
// Destructive is meaningful only when ReadOnly is false. The MCP spec
// defaults it to true when the server sends no hint, which is the safe
// reading and the one published.
Destructive bool
// Idempotent is meaningful only when ReadOnly is false.
Idempotent bool
// OpenWorld reports whether the tool may reach beyond this instance. The
// spec defaults it to true when absent.
OpenWorld bool
Inputs []ToolInput
}
ToolDoc is what a reader needs before pointing an agent at a tool: what it is called, what it does, whether it changes anything, and what it accepts.
func DescribeTools ¶
DescribeTools reports every tool this server exposes, as the server itself reports them over MCP.
The server is constructed with no query backend and an empty dashboard service because registration touches neither: the tool set is fixed at construction and no handler runs here. A nil dashboard service would register no dashboard tools at all, so one is supplied — otherwise this would quietly document a smaller surface than an instance serves.
type ToolInput ¶
ToolInput is one top-level parameter. Nested object properties are not flattened — a JSON Schema is the precise artefact and a table is not the place to restate one, so a nested input is published with its own type and description and a client reads the schema for the rest.
type TraceInput ¶
type TraceInput struct {
From *time.Time `json:"from,omitempty" jsonschema:"Absolute start, RFC3339Nano; requires to and excludes window"`
To *time.Time `json:"to,omitempty" jsonschema:"Absolute end, RFC3339Nano; requires from and excludes window"`
Window string `json:"window,omitempty" jsonschema:"Trace lookup window such as 1h, 24h, 168h, or 720h; defaults to 1h"`
Namespace string `json:"namespace,omitempty" jsonschema:"OpenTelemetry service namespace; empty queries all namespaces"`
TraceID string `json:"trace_id,omitempty" jsonschema:"Exact trace ID; omit to inspect the most relevant recent error or slow trace"`
Service string `json:"service,omitempty" jsonschema:"Optional service filter when choosing a recent trace"`
Limit int `json:"limit,omitempty" jsonschema:"Maximum spans and correlated logs to return, from 1 to 500"`
}