feat: MCP ping tool, tightened descriptions, and Hermes client docs
Some checks failed
ci / build-test (push) Has been cancelled
ci / docker-build (push) Has been cancelled
ci / web (push) Has been cancelled
Desktop App / Build Linux (amd64) (push) Has been cancelled
Desktop App / Attach to Release (push) Has been cancelled

- Add  MCP tool — lightweight connectivity check returning server
  identity, no DB hit (resolves agent connection-test friction)
- Tighten 6 tool descriptions (get_relations, get_health_summary,
  query_metrics, get_trend, get_event_timeline, ping) to be searchable
  in the first 8-12 words
- Document Hermes MCP client setup in ADR-0012 with token security caveat
- Move completed plan to plans/done/
This commit is contained in:
2026-08-05 00:21:56 +02:00
parent 4e294b3630
commit 0dd8c28815
5 changed files with 184 additions and 8 deletions

View File

@@ -30,6 +30,12 @@ type toolReg struct {
// newServer registrations.
func allTools(pool *db.Pool, agentID uuid.UUID) []toolReg {
return []toolReg{
{tool: &mcp.Tool{Name: "ping", Description: "Lightweight connectivity check. Returns server identity, no DB hit.",
InputSchema: objSchema(),
}, handler: func(ctx context.Context, req *mcp.CallToolRequest) (*mcp.CallToolResult, error) {
return textResult(`{"ok":true,"server":"oikos","version":"dev"}`), nil
}},
{tool: &mcp.Tool{Name: "get_entity", Description: "Get an entity by slug or UUID",
InputSchema: objSchema(prop{"slug_or_id", "string", "Entity slug (e.g. host:hubris) or UUID"}),
}, handler: func(ctx context.Context, req *mcp.CallToolRequest) (*mcp.CallToolResult, error) {
@@ -57,7 +63,7 @@ func allTools(pool *db.Pool, agentID uuid.UUID) []toolReg {
nStr(args["type"]), nStr(args["state"]), nStr(args["q"]), limit), "entity_table"), nil
}},
{tool: &mcp.Tool{Name: "get_relations", Description: "Get relationships for an entity",
{tool: &mcp.Tool{Name: "get_relations", Description: "List inbound/outbound edges for one entity",
InputSchema: objSchema(prop{"entity_id", "string", "Entity slug"}),
}, handler: func(ctx context.Context, req *mcp.CallToolRequest) (*mcp.CallToolResult, error) {
args := argsMap(req)
@@ -84,7 +90,7 @@ func allTools(pool *db.Pool, agentID uuid.UUID) []toolReg {
slug, depth), nil
}},
{tool: &mcp.Tool{Name: "get_health_summary", Description: "Current fleet health summary",
{tool: &mcp.Tool{Name: "get_health_summary", Description: "Full fleet health per entity — healthy/degraded/down/unknown",
InputSchema: objSchema(),
}, handler: func(ctx context.Context, req *mcp.CallToolRequest) (*mcp.CallToolResult, error) {
return queryRows(ctx, pool, `
@@ -446,7 +452,7 @@ func allTools(pool *db.Pool, agentID uuid.UUID) []toolReg {
return textResult(fmt.Sprintf("Ended: %s —%s→ %s.", source, relType, target)), nil
}},
{tool: &mcp.Tool{Name: "query_metrics", Description: "Query time-series metrics",
{tool: &mcp.Tool{Name: "query_metrics", Description: "Time-series metrics with bucketed avg/min/max over N hours",
InputSchema: objSchema(prop{"hours", "integer", "Look-back window in hours (default 24)"}),
}, handler: func(ctx context.Context, req *mcp.CallToolRequest) (*mcp.CallToolResult, error) {
args := argsMap(req)
@@ -628,7 +634,7 @@ func allTools(pool *db.Pool, agentID uuid.UUID) []toolReg {
WHERE e.entity_id = $1`, eid), nil
}},
{tool: &mcp.Tool{Name: "get_trend", Description: "Get metric trends for an entity",
{tool: &mcp.Tool{Name: "get_trend", Description: "Metric slope, variance, and averages for an entity over N days",
InputSchema: objSchema(
prop{"entity_id", "string", "Entity slug"},
prop{"days", "integer", "Look-back window in days (default 7)"}),
@@ -649,7 +655,7 @@ func allTools(pool *db.Pool, agentID uuid.UUID) []toolReg {
ORDER BY metric`, slug, days), nil
}},
{tool: &mcp.Tool{Name: "get_event_timeline", Description: "Get recent events",
{tool: &mcp.Tool{Name: "get_event_timeline", Description: "Recent events filtered by severity and entity slug",
InputSchema: objSchema(
prop{"severity", "string", "Filter by severity (info, warn, error)"},
prop{"entity_slug", "string", "Filter by entity slug"},