orbit

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package orbit implements experimental GitLab.com-only MCP tools for GitLab Orbit knowledge graph discovery and query operations.

API reference: https://docs.gitlab.com/api/orbit/

The package talks to GitLab.com Orbit endpoints and falls back to informative not-found results when the experimental feature is unavailable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionSpecs

func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec

ActionSpecs returns the canonical ActionSpec definitions for all GitLab.com Orbit MCP tools.

Each ActionSpec describes a single public Orbit endpoint (status, schema, tools, dsl, query, graph_status) and is used to project both individual tools and meta-tool routes in the MCP server runtime.

These specs are the single source of truth for tool registration, schema, and documentation.

func FormatDSLMarkdown added in v2.0.5

func FormatDSLMarkdown(out DSLOutput) string

FormatDSLMarkdown returns a Markdown-formatted fenced code block with the Orbit query DSL.

Used to display the DSL grammar or schema for LLMs and users.

func FormatGraphStatusMarkdown

func FormatGraphStatusMarkdown(out GraphStatusOutput) string

FormatGraphStatusMarkdown returns a Markdown-formatted summary of Orbit graph indexing status.

Includes indexed project counts, domain node counts, and indexing pipeline state. Used for LLM and user docs.

func FormatQueryMarkdown

func FormatQueryMarkdown(out QueryOutput) string

FormatQueryMarkdown returns a Markdown-formatted summary of an Orbit query result.

If FormattedText is present, it is rendered as a fenced code block. Otherwise, the result is shown as JSON.

func FormatSchemaMarkdown

func FormatSchemaMarkdown(out SchemaOutput) string

FormatSchemaMarkdown returns a Markdown-formatted summary of the Orbit Knowledge Graph schema.

Includes schema version, domain table, and counts of nodes and edges. Used for LLM and user-facing docs.

func FormatStatusMarkdown

func FormatStatusMarkdown(out StatusOutput) string

FormatStatusMarkdown returns a Markdown-formatted summary of Orbit cluster health for LLM consumption.

Includes status, version, timestamp, and a table of subsystem components with replica counts. If FormattedText is present, it is rendered as a fenced code block.

func FormatToolsMarkdown

func FormatToolsMarkdown(out ToolsOutput) string

FormatToolsMarkdown returns a Markdown-formatted table of Orbit MCP tool definitions.

Each row shows the tool name and description. Used for LLM tool discovery and user docs.

Types

type DSLInput added in v2.0.5

type DSLInput struct {
	ResponseFormatInput
}

DSLInput holds parameters for retrieving the Orbit query DSL.

type DSLOutput added in v2.0.5

type DSLOutput struct {
	toolutil.HintableOutput
	ResponseFormat string `json:"response_format,omitempty"`
	Content        string `json:"content,omitempty"`
}

DSLOutput is the raw Orbit query DSL response.

func DSL added in v2.0.5

func DSL(ctx context.Context, client *gitlabclient.Client, input DSLInput) (DSLOutput, error)

DSL retrieves the Orbit query DSL body verbatim.

type GraphStatusDomain

type GraphStatusDomain struct {
	Name  string                  `json:"name,omitempty"`
	Items []GraphStatusDomainItem `json:"items,omitempty"`
}

GraphStatusDomain describes indexing counts for a graph domain.

type GraphStatusDomainItem

type GraphStatusDomainItem struct {
	Name  string `json:"name,omitempty"`
	Count int64  `json:"count"`
}

GraphStatusDomainItem describes a count for one Orbit graph node type.

type GraphStatusIndexing

type GraphStatusIndexing struct {
	State           string `json:"state,omitempty"`
	LastStartedAt   string `json:"last_started_at,omitempty"`
	LastCompletedAt string `json:"last_completed_at,omitempty"`
	LastDurationMs  int64  `json:"last_duration_ms,omitempty"`
	LastError       string `json:"last_error,omitempty"`
}

GraphStatusIndexing describes the latest indexing pipeline state.

type GraphStatusInput

type GraphStatusInput struct {
	NamespaceID int64  `` /* 132-byte string literal not displayed */
	ProjectID   int64  `json:"project_id,omitempty"   jsonschema:"Project ID to inspect. Set exactly one of namespace_id, project_id, or full_path."`
	FullPath    string `` /* 146-byte string literal not displayed */
	ResponseFormatInput
}

GraphStatusInput holds parameters for retrieving Orbit graph indexing status.

type GraphStatusOutput

type GraphStatusOutput struct {
	toolutil.HintableOutput
	FormattedText string               `json:"formatted_text,omitempty"`
	Projects      *GraphStatusProjects `json:"projects,omitempty"`
	Domains       []GraphStatusDomain  `json:"domains,omitempty"`
	Indexing      *GraphStatusIndexing `json:"indexing,omitempty"`
}

GraphStatusOutput is the Orbit graph indexing status response.

func GraphStatus

func GraphStatus(ctx context.Context, client *gitlabclient.Client, input GraphStatusInput) (GraphStatusOutput, error)

GraphStatus retrieves Orbit graph indexing status for a namespace or project.

type GraphStatusProjects

type GraphStatusProjects struct {
	Indexed    int64 `json:"indexed"`
	TotalKnown int64 `json:"total_known"`
}

GraphStatusProjects describes indexed and known project counts.

type QueryInput

type QueryInput struct {
	Query map[string]any `json:"query" jsonschema:"Orbit query DSL JSON object,required"`
	ResponseFormatInput
}

QueryInput holds parameters for executing an Orbit Knowledge Graph query.

type QueryOutput

type QueryOutput struct {
	toolutil.HintableOutput
	FormattedText   string   `json:"formatted_text,omitempty"`
	Result          any      `json:"result,omitempty"`
	QueryType       string   `json:"query_type,omitempty"`
	RawQueryStrings []string `json:"raw_query_strings,omitempty"`
	RowCount        int64    `json:"row_count,omitempty"`
}

QueryOutput is the result envelope returned by Orbit query execution.

func Query

func Query(ctx context.Context, client *gitlabclient.Client, input QueryInput) (QueryOutput, error)

Query executes an Orbit Knowledge Graph query.

type ResponseFormatInput

type ResponseFormatInput struct {
	ResponseFormat string `json:"response_format,omitempty" jsonschema:"Response format to request: raw or llm. Defaults to raw."`
}

type SchemaDomain

type SchemaDomain struct {
	Name        string   `json:"name,omitempty"`
	Description string   `json:"description,omitempty"`
	NodeNames   []string `json:"node_names,omitempty"`
}

SchemaDomain describes a logical grouping of Orbit graph node types.

type SchemaEdge

type SchemaEdge struct {
	Name        string              `json:"name,omitempty"`
	Description string              `json:"description,omitempty"`
	Variants    []SchemaEdgeVariant `json:"variants,omitempty"`
}

SchemaEdge describes an Orbit graph edge type.

type SchemaEdgeVariant

type SchemaEdgeVariant struct {
	SourceType string `json:"source_type,omitempty"`
	TargetType string `json:"target_type,omitempty"`
}

SchemaEdgeVariant describes a valid source/target pair for an Orbit edge.

type SchemaInput

type SchemaInput struct {
	Expand         []string `json:"expand,omitempty" jsonschema:"Node names to expand with full properties and relationships."`
	Format         string   `json:"format,omitempty" jsonschema:"Schema response format to request: raw or llm. Defaults to raw."`
	ResponseFormat string   `` /* 136-byte string literal not displayed */
}

SchemaInput holds parameters for retrieving the Orbit graph schema.

type SchemaOutput

type SchemaOutput struct {
	toolutil.HintableOutput
	SchemaVersion string         `json:"schema_version,omitempty"`
	Domains       []SchemaDomain `json:"domains,omitempty"`
	Nodes         []any          `json:"nodes,omitempty"`
	Edges         []SchemaEdge   `json:"edges,omitempty"`
}

SchemaOutput is the Orbit graph ontology response.

func Schema

func Schema(ctx context.Context, client *gitlabclient.Client, input SchemaInput) (SchemaOutput, error)

Schema retrieves the Orbit graph ontology.

type StatusComponent

type StatusComponent struct {
	Name     string          `json:"name,omitempty"`
	Status   string          `json:"status,omitempty"`
	Replicas *StatusReplicas `json:"replicas,omitempty"`
	Metrics  any             `json:"metrics,omitempty"`
}

StatusComponent describes an Orbit subsystem status entry.

type StatusInput

type StatusInput struct {
	ResponseFormatInput
}

StatusInput holds parameters for retrieving Orbit cluster status.

type StatusOutput

type StatusOutput struct {
	toolutil.HintableOutput
	FormattedText string            `json:"formatted_text,omitempty"`
	Status        string            `json:"status,omitempty"`
	Timestamp     string            `json:"timestamp,omitempty"`
	Version       string            `json:"version,omitempty"`
	Components    []StatusComponent `json:"components,omitempty"`
}

StatusOutput is the Orbit cluster health response.

func Status

func Status(ctx context.Context, client *gitlabclient.Client, input StatusInput) (StatusOutput, error)

Status retrieves Orbit cluster health.

type StatusReplicas

type StatusReplicas struct {
	Ready   int64 `json:"ready"`
	Desired int64 `json:"desired"`
}

StatusReplicas describes ready and desired replica counts for an Orbit component.

type ToolDefinition

type ToolDefinition struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	Parameters  any    `json:"parameters,omitempty"`
}

ToolDefinition describes one MCP tool manifest entry served by Orbit.

type ToolsInput

type ToolsInput struct{}

ToolsInput is the input for listing Orbit MCP tool manifests.

type ToolsOutput

type ToolsOutput struct {
	toolutil.HintableOutput
	Tools []ToolDefinition `json:"tools,omitempty"`
}

ToolsOutput is the Orbit MCP tool manifest response.

func Tools

func Tools(ctx context.Context, client *gitlabclient.Client, _ ToolsInput) (ToolsOutput, error)

Tools retrieves the Orbit MCP tool manifest.

Jump to

Keyboard shortcuts

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