Documentation
¶
Overview ¶
Package namespaces defines optional catalog tools shared by MCP applications. These are ordinary registered tools, not additions to the MCP wire schema.
Index ¶
- Constants
- Variables
- func Paginate[T any](entries []T, cursor *string, pageSize int) ([]T, *string, error)
- func ParseURI(value string) (string, error)
- func URI(id string) (string, error)
- type GetRequest
- type GetResult
- type ListRequest
- type ListResult
- type Namespace
- type Resource
- type ResourceGetRequest
Constants ¶
const ( ListToolName = "namespaces/list" GetToolName = "namespaces/get" // ResourceGetToolName is a legacy ordinary tool name. New publishers and // clients use the standard MCP resources/read method instead. ResourceGetToolName = "resource/get" )
Variables ¶
var ErrCursor = errors.New("invalid or stale namespace catalog cursor")
var ErrURI = errors.New("invalid namespace URI")
Functions ¶
func Paginate ¶
Paginate follows the existing skills catalog's snapshot/offset cursor convention. The owner MUST authorize, filter and deterministically sort the collection before calling this helper. It neither grants access nor filters resources, and clients must treat returned cursors as opaque.
Types ¶
type GetRequest ¶
type GetResult ¶
type GetResult struct {
Resources []Resource `json:"resources" yaml:"resources"`
NextCursor *string `json:"nextCursor,omitempty" yaml:"nextCursor,omitempty"`
Namespace *Namespace `json:"namespace,omitempty" yaml:"namespace,omitempty"`
}
GetResult contains resource summaries, not full definitions. Absence of NextCursor marks the end of this caller's accessible, filtered collection.
type ListRequest ¶
type ListRequest struct {
Cursor *string `json:"cursor,omitempty" yaml:"cursor,omitempty"`
}
type ListResult ¶
type ResourceGetRequest ¶
type ResourceGetRequest struct {
URI string `json:"uri" yaml:"uri"`
}
ResourceGetRequest is retained for legacy ordinary tool adapters. Standard MCP clients select resource contents with resources/read and params.uri.