Files
ZacharyZhang-NY eb50367921
ci / backend (push) Failing after 3m25s
ci / mcp (push) Successful in 21s
ci / interface (push) Successful in 19s
ci / image (push) Failing after 1m5s
Move the canonical host to git.zacharyzhang.com and follow the module path
The GitHub account that hosted this repository is suspended, so the remote
is dead and the vanity import github.com/ZacharyZhang-NY/ely-eye/... no
longer resolves. The Go module path is that import, so it moves with the
host: git.zacharyzhang.com serves a go-import meta tag for the nested
ely-eye-mcp submodule, which go build and go get both need.

The installers read release assets from the host too, so their API and
download URLs move with it. The release workflow's -ldflags symbol path is
the module path, so it moves as well; a build stamped with the new path
prints the stamped version.
2026-10-10 11:26:19 -04:00

45 lines
1.5 KiB
Go

package mcpserver
import (
"context"
"strings"
"git.zacharyzhang.com/ZacharyZhang-NY/ely-eye/ely-eye-mcp/internal/domain"
"github.com/modelcontextprotocol/go-sdk/mcp"
)
type CardInput struct {
HolderID string `json:"holder_id,omitempty" jsonschema:"optional exact holder id; ask for that holder's card instead of the whole store's"`
}
type CardOutput struct {
Card *domain.CapabilityCard `json:"card,omitempty"`
Holder *domain.HolderCard `json:"holder,omitempty"`
}
// registerCardTools adds the read that needs no memory access at all: what this
// store can answer. A caller with a new batch of questions reads the card first
// instead of discovering the gaps one question at a time.
func (s *Server) registerCardTools(server *mcp.Server) {
mcp.AddTool(server, &mcp.Tool{
Name: "ely_eye_card",
Title: "Capability card",
Description: "What this store can answer, derived from what it holds: schema version, senses present, which holders exist and what they hold, and what is mounted. No memory text is shown, so it is safe to read before trusting the store.",
}, s.cardTool)
}
func (s *Server) cardTool(ctx context.Context, _ *mcp.CallToolRequest, input CardInput) (*mcp.CallToolResult, CardOutput, error) {
if strings.TrimSpace(input.HolderID) == "" {
card, err := s.api.Card(ctx)
if err != nil {
return nil, CardOutput{}, err
}
return nil, CardOutput{Card: card}, nil
}
holder, err := s.api.HolderCard(ctx, input.HolderID)
if err != nil {
return nil, CardOutput{}, err
}
return nil, CardOutput{Holder: holder}, nil
}