Help us shape the future of Go! Take the 2026 Go Developer Survey

orbit

package
v3.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package orbit implements MCP tools for the experimental GitLab Orbit Knowledge Graph API on GitLab.com.

Six read-only handlers wrap the public Orbit endpoints and are exposed as individual tools (gitlab_orbit_*) and a consolidated meta-tool (gitlab_orbit):

  • Status: GET /api/v4/orbit/status (cluster health)
  • Schema: GET /api/v4/orbit/schema (graph ontology)
  • Tools: GET /api/v4/orbit/tools (MCP tool manifest)
  • DSL: GET /api/v4/orbit/agent/commands (query language, GQL)
  • Query: POST /api/v4/orbit/query (read-only graph query)
  • GraphStatus: GET /api/v4/orbit/graph_status (indexing status)

Orbit is gated to GitLab.com Premium/Ultimate with the knowledge_graph feature flag enabled. The package returns informative not-found results when the experimental feature is unavailable or the token cannot access a Knowledge Graph-enabled namespace or project.

Reference: https://docs.gitlab.com/api/orbit/

The Query handler forwards a query as the caller wrote it, checking only that one was given as GQL text or a JSON object. GQL, the read-only openCypher 9 based language, is what GitLab.com compiles every query in since it turned orbit_gql_queries on for everyone on 2026-10-15, and DSL describes it from the query_graph command GitLab.com publishes; the route that served the JSON query DSL before, GET /api/v4/orbit/schema/dsl, answers 404 since then, and nothing here asks it (issue 1414). An object is the JSON DSL, still forwarded rather than refused so it works if GitLab.com turns GQL back off, and answered with a hint that GitLab.com reads GQL when GitLab refuses it for its language. The language changes during the Orbit beta: GitLab compiles each query and refuses what it cannot run with a message naming the fault, which reaches the caller rather than being replaced by rules written here, which went stale once already (issue 1031).

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

func FormatDSLMarkdown(out DSLOutput) string

FormatDSLMarkdown renders the Orbit query language as the card of one object: the command a query runs as, its grammar and the JSON Schema of its input, each inside a fence sized to it, or the compact text GitLab answers the llm format with as the whole body.

The grammar names no entity, so every shape of the card ends on the action that lists them, and the card says so when GitLab described no query command at all, which is also what a caller is told while the route this action read until issue 1414, GET /orbit/schema/dsl, answers 404.

func FormatGraphStatusMarkdown

func FormatGraphStatusMarkdown(out GraphStatusOutput) string

FormatGraphStatusMarkdown renders Orbit indexing status as the card of one object: how much is indexed, how the last run went, and the per-domain node counts as a nested collection.

func FormatQueryMarkdown

func FormatQueryMarkdown(out QueryOutput) string

FormatQueryMarkdown renders one query result as the card of one object: what was asked and how much came back, then the query text and the rows as fenced bodies.

func FormatSchemaMarkdown

func FormatSchemaMarkdown(out SchemaOutput) string

FormatSchemaMarkdown renders the Knowledge Graph ontology as the card of one object: the version and the three type counts, then the domains as a nested collection. The compact text GitLab answers the llm format with is the whole response, so it is rendered as the card's body instead.

Its next steps lead to the query language and then to a query. They used to lead to orbit.tools for "the live query and tool manifest", which is the manifest of the MCP tools Orbit serves (list_commands and invoke_command on GitLab.com, read 2026-10-06) and describes no query: the grammar is what orbit.dsl returns, read from the query_graph command since issue 1414.

The edge types and the nodes GitLab answered expanded are written out too (issue 1311). The card used to stop at the counts and the domains, so the relationship names and the properties a query is built from were in the structured output alone, and a client that hands the model the text, as most do on the default surface, left it to guess them while the last step spoke of "the node and edge types listed here". A schema with nodes and none of them expanded therefore adds a step saying how to ask for their properties.

func FormatStatusMarkdown

func FormatStatusMarkdown(out StatusOutput) string

FormatStatusMarkdown renders Orbit cluster health as the card of one object: whether the caller reaches the graph at all, the cluster's own health, and the subsystems as a nested collection.

Two of those rows were missing, and both are the answer to the question the action is asked. "Available to you" is the user-level access flag, which is what separates a healthy cluster the caller cannot query from one they can; "Error" is what the backend says when it cannot reach the gRPC cluster, which is exactly the case where "Status: unknown" alone explains nothing.

func FormatToolsMarkdown

func FormatToolsMarkdown(out ToolsOutput) string

FormatToolsMarkdown renders the Orbit tool manifest as a table: a collection of objects that share columns.

The name goes in a code span through the cell form of the span writer. It used to be stripped of every backtick it held and then run through the cell escaper inside a hand-written span, which showed "|" as those five characters and quietly deleted part of the name.

The tools listed are Orbit's own, which a query sent through orbit.query does not use, so the next steps lead to the grammar and the names a query is built from rather than to the parameters these tools declare.

Types

type DSLInput

type DSLInput struct {
	ResponseFormatInput
}

DSLInput holds parameters for retrieving the Orbit query language.

type DSLOutput

type DSLOutput struct {
	toolutil.HintableOutput
	// ResponseFormat echoes the response_format that was asked for ("raw" for
	// the command as a JSON object, "llm" for it as compact text), or nothing
	// when GitLab chose its default, raw.
	ResponseFormat string `json:"response_format,omitempty"`
	// FormattedText is the command as compact text, which is the whole of
	// GitLab's answer when the caller selected the "llm" response format.
	FormattedText string `json:"formatted_text,omitempty"`
	// Name is the name of the Orbit command a query runs as, query_graph,
	// under the key GitLab sends it with.
	Name string `json:"name,omitempty"`
	// Description is the grammar of the query language as the command
	// describes it.
	Description string `json:"description,omitempty"`
	// Parameters is the decoded JSON Schema of the command's input, whose
	// query property is the query text orbit.query sends.
	Parameters any `json:"parameters,omitempty"`
}

DSLOutput is the query language GitLab.com compiles orbit.query in, as the Orbit command a graph query runs as describes it.

GitLab.com reads every query as GQL since it turned orbit_gql_queries on for everyone at 01:06 UTC on 2026-10-15, and GET /api/v4/orbit/schema/dsl, which served the JSON DSL this type used to carry whole, answers 404 since then (issue 1414). What GitLab publishes for GQL instead is the query_graph command of GET /api/v4/orbit/agent/commands: a description of the grammar and the JSON Schema of the command's input. The other two GQL routes publish no grammar: GET /orbit/schema/format is the JSON Schema of a query's answer, and GET /orbit/query/templates lists named queries written in GQL.

func DSL

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

DSL retrieves the query language GitLab.com compiles orbit.query in, as the query_graph command describes it.

Endpoint: GET /api/v4/orbit/agent/commands?command_names=query_graph. With response_format="raw" (GitLab's default) the body is a list of commands, and the query_graph entry gives the grammar's description and the JSON Schema of the command's input; with response_format="llm" it is {"formatted_text": ...}, the same command as compact text. Under GQL, which GitLab.com reads every query in since 2026-10-15, the description is the GQL grammar, and the route this action used to read, GET /orbit/schema/dsl, answers 404, so nothing here asks it (issue 1414). The Knowledge Graph describes only the language it reads for the caller, so the description is of the JSON DSL again for a caller GitLab serves that language to.

type GraphStatusDomain

type GraphStatusDomain struct {
	// Name is the domain identifier (e.g. "SDLC").
	Name string `json:"name,omitempty"`
	// Items are the per-node-type counts in this domain.
	Items []GraphStatusDomainItem `json:"items,omitempty"`
}

GraphStatusDomain describes indexing counts for a graph domain.

type GraphStatusDomainItem

type GraphStatusDomainItem struct {
	// Name is the node-type identifier (e.g. "MergeRequest").
	Name string `json:"name,omitempty"`
	// Count is the number of indexed nodes of this type.
	Count int64 `json:"count"`
}

GraphStatusDomainItem describes a count for one Orbit graph node type.

type GraphStatusIndexing

type GraphStatusIndexing struct {
	// State is the indexing pipeline state (e.g. "indexed", "running", "error").
	State string `json:"state,omitempty"`
	// LastStartedAt is the UTC RFC3339 timestamp of the last indexing run start.
	LastStartedAt string `json:"last_started_at,omitempty"`
	// LastCompletedAt is the UTC RFC3339 timestamp of the last successful indexing run.
	LastCompletedAt string `json:"last_completed_at,omitempty"`
	// LastDurationMs is the duration of the last indexing run in milliseconds.
	LastDurationMs int64 `json:"last_duration_ms,omitempty"`
	// LastError is the last indexing error message, or empty when the
	// last run completed successfully.
	LastError string `json:"last_error,omitempty"`
}

GraphStatusIndexing describes the latest indexing pipeline state.

type GraphStatusInput

type GraphStatusInput struct {
	// NamespaceID targets a group by ID. Mutually exclusive with ProjectID
	// and FullPath; exactly one of the three must be set.
	NamespaceID int64 `` /* 132-byte string literal not displayed */
	// ProjectID targets a project by ID. Mutually exclusive with
	// NamespaceID and FullPath; exactly one of the three must be set.
	ProjectID int64 `json:"project_id,omitempty" jsonschema:"Project ID to inspect. Set exactly one of namespace_id, project_id, or full_path."`
	// FullPath targets a group or project by full path
	// (e.g. "gitlab-org/gitlab"). Mutually exclusive with NamespaceID
	// and ProjectID; exactly one of the three must be set.
	FullPath string `` /* 143-byte string literal not displayed */
	ResponseFormatInput
}

GraphStatusInput holds parameters for retrieving Orbit graph indexing status.

type GraphStatusOutput

type GraphStatusOutput struct {
	toolutil.HintableOutput
	// FormattedText is the pre-formatted text body returned by the
	// server when the caller selected the "llm" response format.
	FormattedText string `json:"formatted_text,omitempty"`
	// Projects summarizes the indexed vs. known project counts.
	Projects *GraphStatusProjects `json:"projects,omitempty"`
	// Domains are the per-domain indexing counts.
	Domains []GraphStatusDomain `json:"domains,omitempty"`
	// Indexing is the latest indexing pipeline state.
	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 single namespace, project, or full path on GitLab.com.

Endpoint: GET /api/v4/orbit/graph_status. Exactly one of namespace_id, project_id, or full_path must be set. Useful for verifying that the indexer has caught up before running Query.

The count of projects the indexer gave up on, projects.gaps, is read from the captured response (gitlabclient.WithResponseCapture), since client-go does not model it; see GraphStatusProjects.Gaps.

type GraphStatusProjects

type GraphStatusProjects struct {
	// Indexed is the number of projects whose Knowledge Graph is
	// up to date in the index.
	Indexed int64 `json:"indexed"`
	// TotalKnown is the total number of projects eligible for indexing.
	TotalKnown int64 `json:"total_known"`
	// Gaps is the number of projects the indexer gave up on: every attempt
	// it is allowed was used and none produced an index (ProjectsStatus.gaps
	// in crates/orbit-server/proto/orbit.proto of
	// gitlab-org/orbit/knowledge-graph). client-go's OrbitGraphStatusProjects
	// does not model it, so [GraphStatus] reads it from the captured response
	// (register row 93 of docs/development/upstream-bugs.md).
	Gaps int64 `json:"gaps"`
}

GraphStatusProjects describes indexed and known project counts.

type QueryInput

type QueryInput struct {
	Query any `` /* 958-byte string literal not displayed */
	// ResponseFormat selects the answer's shape. POST /orbit/query declares
	// a third value beside raw and llm, which is why this input carries its
	// own field rather than [ResponseFormatInput] (`values: %w[raw llm gql]`
	// in ee/lib/api/orbit/data.rb):
	//   - "raw": the structured envelope, sent when the field is omitted
	//   - "llm": compact text optimized for LLM consumption
	//   - "gql": the result as a graph pattern table, text like llm
	//
	// "json" is read as "raw", for the reason [ResponseFormatInput] gives.
	ResponseFormat string `` /* 189-byte string literal not displayed */
}

QueryInput holds parameters for executing an Orbit Knowledge Graph query.

The Query field is GQL text, the read-only subset of openCypher 9 syntax the Knowledge Graph compiles, which is the language GitLab.com reads every query in since it turned orbit_gql_queries on for everyone at 01:06 UTC on 2026-10-15 (gitlab-org/gitlab!256465 has Rails send the language the flag selects, and the compiler refuses the other). DSL describes it from what GitLab.com publishes. This server checks only that a query was given and that it is text or a JSON object: GitLab compiles it and refuses what it cannot run with a message naming the line and column of the fault, which reaches the caller (toolutil's Workhorse query refusal). Rules written here would only go stale, which is what issue 1031 was.

A query given as a JSON object is forwarded as written rather than refused here, so it keeps working if GitLab.com turns the flag back off before gitlab-org/gitlab!261947 removes the JSON DSL. While GitLab.com reads GQL it answers such a query with compile_error, and [wrapQueryErr] then says that GitLab.com reads queries as GQL, with an example (issue 1414).

The statement, as the Orbit query frontend states it (docs/design-documents/querying/orbit_query_frontend.md in gitlab-org/orbit/knowledge-graph):

MATCH pattern [WHERE predicates]
[MATCH pattern [WHERE predicates] ...]
RETURN projections
[ORDER BY key [ASC | DESC]]
[LIMIT rows | PAGE rows [AFTER 'token']]

Every node carries a label where it first appears, and at least one is bounded by its id or a literal property, inline or in WHERE. A relationship type follows a colon, -[:IN_PROJECT]->, a repeat is bounded (*1..3), and no path is longer than three hops. WHERE combines predicates with AND and NOT. RETURN selects properties or whole nodes, and count, sum, avg, min and max aggregate, every other item becoming a group key. A neighbors query has one labeled, bounded node and a far endpoint with a variable and nothing else, and a shortest path is written MATCH path = ANY SHORTEST (a)-[...]->(b) RETURN path. CALL db.schema() and CALL db.schema('Node') answer the ontology. The query type of the answer is inferred from the statement.

Examples, each answered 200 by GitLab.com on 2026-10-17:

MATCH (p:Project {full_path: 'plens1/kg-fixtures'}) RETURN p.id, p.full_path, p.name
MATCH (mr:MergeRequest)-[:IN_PROJECT]->(p:Project) WHERE p.full_path STARTS WITH 'plens1/' RETURN p, count(mr) AS mr_count ORDER BY mr_count DESC
MATCH (p:Project {full_path: 'plens1/kg-fixtures'})--(n) RETURN n
MATCH path = ANY SHORTEST (mr:MergeRequest {source_branch: 'feature/restock-helper'})-[:IN_PROJECT*1..2]->(p:Project {full_path: 'plens1/kg-fixtures'}) RETURN path

type QueryOutput

type QueryOutput struct {
	toolutil.HintableOutput
	// FormattedText is the text body returned by the server when the
	// caller selected the "llm" response format, or the graph pattern
	// table of the "gql" one.
	FormattedText string `json:"formatted_text,omitempty"`
	// Result is the decoded result envelope returned for the
	// "raw" response format. Its shape depends on the
	// query_type: traversal returns a list of row objects,
	// aggregation returns aggregation rows, neighbors returns the
	// neighbor expansion, and path_finding returns the matching paths.
	Result any `json:"result,omitempty"`
	// QueryType echoes the query_type that produced this result
	// (traversal, aggregation, neighbors, or path_finding).
	QueryType string `json:"query_type,omitempty"`
	// RawQueryStrings are the SQL strings the server executed for
	// the request; useful for debugging slow or unexpected queries.
	RawQueryStrings []string `json:"raw_query_strings,omitempty"`
	// RowCount is the number of rows in the result envelope.
	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 a read-only Orbit Knowledge Graph query on GitLab.com.

Endpoint: POST /api/v4/orbit/query. The query is forwarded as the caller wrote it, once [encodeQuery] has checked there is one and that it is text or an object: GQL text reaches GitLab as the body's query string, {"query": "<GQL text>"}, and an object as that object. See QueryInput for the language. GitLab judges everything else, and a query it refuses comes back as a 400 whose message says what to change, with [wrapQueryErr]'s hint pointing at the two actions that describe the language and the graph.

GitLab infers the query type from the statement and answers it beside the result: traversal, aggregation, neighbors or path_finding.

When response_format is omitted, the handler sends "raw" (structured JSON) explicitly rather than leaving the choice to GitLab's default, which is "raw" today (ee/lib/api/orbit/data.rb) and was not always. Structured JSON is strictly more useful for an MCP tool: the LLM can iterate over result nodes directly, the SDK decodes row_count, and downstream markdown formatters pretty-print the envelope. Callers who want the compact TOON text pass response_format="llm", and the graph pattern table "gql"; both are text GitLab answers whole, which client-go's QueryRaw hands back as it came.

type ResponseFormatInput

type ResponseFormatInput struct {
	// ResponseFormat selects the Orbit response shape. GitLab declares
	// two values on every route that takes it (ee/lib/api/orbit/data.rb,
	// `values: %w[raw llm]`):
	//   - "raw": structured JSON
	//   - "llm": compact text optimized for LLM consumption
	//
	// "json" is accepted here as a synonym of "raw" and sent as "raw":
	// GitLab answers 400 "response_format does not have a valid value"
	// to it on every route, and it was offered here as a value of its
	// own until that was measured.
	//
	// When empty the parameter is not sent and GitLab applies its own
	// default, which is "raw" on every route.
	ResponseFormat string `` /* 144-byte string literal not displayed */
}

ResponseFormatInput is the shared response_format selector used by the status, dsl and graph_status Orbit endpoints. The query endpoint takes a third value and declares its own field (QueryInput.ResponseFormat).

type SchemaDomain

type SchemaDomain struct {
	// Name is the domain identifier (e.g. "core", "sdlc").
	Name string `json:"name,omitempty"`
	// Description is the human-readable domain summary.
	Description string `json:"description,omitempty"`
	// NodeNames are the ontology node types in the domain.
	NodeNames []string `json:"node_names,omitempty"`
}

SchemaDomain describes a logical grouping of Orbit graph node types.

type SchemaEdge

type SchemaEdge struct {
	// Name is the edge type identifier (e.g. "AUTHORED", "IN_PROJECT").
	Name string `json:"name,omitempty"`
	// Description is the human-readable edge summary.
	Description string `json:"description,omitempty"`
	// Variants are the valid source/target node-type pairs.
	Variants []SchemaEdgeVariant `json:"variants,omitempty"`
}

SchemaEdge describes an Orbit graph edge type.

type SchemaEdgeVariant

type SchemaEdgeVariant struct {
	// SourceType is the source node type (e.g. "User").
	SourceType string `json:"source_type,omitempty"`
	// TargetType is the target node type (e.g. "Issue").
	TargetType string `json:"target_type,omitempty"`
}

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

type SchemaInput

type SchemaInput struct {
	// Expand lists node names whose full properties and relationships
	// should be hydrated in the response.
	Expand []string `json:"expand,omitempty" jsonschema:"Node names to expand with full properties and relationships."`
	// Format selects the schema response shape: "raw" or "llm", with
	// "json" read as "raw" for the reason [ResponseFormatInput] gives.
	// Empty leaves GitLab's default ("raw"). Whichever of the two
	// input names carries it, it reaches GitLab as response_format,
	// which is the only name the route declares.
	Format string `` /* 142-byte string literal not displayed */
	// ResponseFormat is an alias for Format, under the name GitLab
	// declares for the parameter. Must match Format when both are set.
	ResponseFormat string `json:"response_format,omitempty" jsonschema:"Alias for format. Must match format when both are set."`
}

SchemaInput holds parameters for retrieving the Orbit graph schema.

type SchemaOutput

type SchemaOutput struct {
	toolutil.HintableOutput
	// FormattedText is the ontology as compact text, which is the whole
	// of GitLab's answer when the caller selected the "llm" response
	// format. client-go's OrbitSchema does not model the key, so it is
	// read from the captured response.
	FormattedText string `json:"formatted_text,omitempty"`
	// SchemaVersion is the Orbit ontology version string.
	SchemaVersion string `json:"schema_version,omitempty"`
	// Domains are the logical groupings of node types.
	Domains []SchemaDomain `json:"domains,omitempty"`
	// Nodes are the decoded node-type definitions. The Orbit API
	// evolves the node shape, so the SDK exposes the list as raw JSON
	// values rather than fixed Go types.
	Nodes []any `json:"nodes,omitempty"`
	// Edges are the graph edge types.
	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 (domains, node types, edge types) from GitLab.com.

Endpoint: GET /api/v4/orbit/schema. The expand parameter hydrates the named node types with full properties; the response format selects the structured ontology (raw) or the compact text one (llm).

The format is sent as response_format through [responseFormatQuery] rather than through client-go's GetOrbitSchemaOptions.Format, which encodes it as `format`. Grape reserves that name for the representation it renders, so GitLab answered 406 "The requested format 'llm' is not supported." to either value and the response format never reached the route. The option struct is left without a format for that reason, and the compact text GitLab then answers with is read from the captured response, since OrbitSchema models no formatted_text.

type StatusComponent

type StatusComponent struct {
	// Name is the subsystem identifier (e.g. "clickhouse", "api").
	Name string `json:"name,omitempty"`
	// Status is the subsystem health label (e.g. "healthy").
	Status string `json:"status,omitempty"`
	// Replicas are the ready/desired counts, or nil when the
	// subsystem is stateless.
	Replicas *StatusReplicas `json:"replicas,omitempty"`
	// Metrics is the decoded raw JSON metrics payload for the subsystem.
	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
	// User mirrors the user-level access object from the nested
	// response shape, or nil for the flat shape.
	User *StatusUser `json:"user,omitempty"`
	// System mirrors the cluster health object from the nested
	// response shape, or nil for the flat shape.
	System *StatusSystem `json:"system,omitempty"`
	// FormattedText is the pre-formatted text body returned by the
	// server when the caller selected the "llm" response format.
	FormattedText string `json:"formatted_text,omitempty"`
	// Status is the cluster-level health label.
	Status string `json:"status,omitempty"`
	// Timestamp is the server-side snapshot time, RFC3339.
	Timestamp string `json:"timestamp,omitempty"`
	// Version is the Orbit service version.
	Version string `json:"version,omitempty"`
	// Components are the per-subsystem status entries.
	Components []StatusComponent `json:"components,omitempty"`
}

StatusOutput is the Orbit cluster health response.

The flat fields (FormattedText, Status, Timestamp, Version, Components) are always populated: the SDK promotes the nested system object's fields into them for backward compatibility. User and System carry the new nested shape directly when the server emits it, and are nil for the old flat shape.

func Status

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

Status retrieves the Orbit cluster health snapshot from GitLab.com.

Endpoint: GET /api/v4/orbit/status. Returns subsystem components, replica counts, version, and timestamp. Falls back to an informative not-found result when the Orbit feature is not enabled.

type StatusReplicas

type StatusReplicas struct {
	// Ready is the current number of healthy replicas.
	Ready int64 `json:"ready"`
	// Desired is the target number of replicas.
	Desired int64 `json:"desired"`
}

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

type StatusSystem

type StatusSystem struct {
	// FormattedText is the pre-formatted text body, when present.
	FormattedText string `json:"formatted_text,omitempty"`
	// Status is the cluster-level health label.
	Status string `json:"status,omitempty"`
	// Timestamp is the server-side snapshot time, RFC3339.
	Timestamp string `json:"timestamp,omitempty"`
	// Version is the Orbit service version.
	Version string `json:"version,omitempty"`
	// Error is the backend error message emitted when the gRPC
	// cluster is unreachable, or empty otherwise.
	Error string `json:"error,omitempty"`
	// Components are the per-subsystem status entries.
	Components []StatusComponent `json:"components,omitempty"`
}

StatusSystem mirrors the cluster health object returned in the new nested shape of the Orbit status response. It carries the same health fields as the flat shape, plus an Error field emitted when the backend cannot reach the gRPC cluster (Status is "unknown" in that case). Present only for the nested shape; nil otherwise.

type StatusUser

type StatusUser struct {
	// Available reports whether the calling user has access to the
	// Knowledge Graph.
	Available bool `json:"available"`
}

StatusUser mirrors the user-level access object returned in the new nested shape of the Orbit status response. It is present only when the server emits the nested shape; nil for the old flat shape.

type ToolDefinition

type ToolDefinition struct {
	// Name is the tool name as Orbit exposes it.
	Name string `json:"name,omitempty"`
	// Description is the tool's human-readable description.
	Description string `json:"description,omitempty"`
	// Parameters is the decoded JSON Schema for the tool's input.
	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 the Orbit MCP tool manifest. The endpoint accepts no parameters; the type exists so the handler signature is uniform with the other Orbit handlers.

type ToolsOutput

type ToolsOutput struct {
	toolutil.HintableOutput
	// Tools is the list of MCP tools Orbit exposes.
	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 and parameter schemas.

Endpoint: GET /api/v4/orbit/tools. The manifest lists the tools Orbit exposes alongside the JSON Schema of each tool's parameters; use it to learn the canonical query shapes before calling Query.

Jump to

Keyboard shortcuts

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