add-mcp-toollisted
Install: claude install-skill radimsem/remindb
# Add a new MCP tool
Tools live in `pkg/mcp/tools/` as one file per tool. Each tool is a method on `*Deps` that takes a typed input struct, calls into `Store` / `Engine` / `Tracker`, and returns a `*mcp.CallToolResult` with text content. Adding one means *four* changes plus a docs sync.
## Where it lands
| File | What changes |
|---|---|
| `pkg/mcp/tools/<tool>.go` | New file — `XxxInput` struct + `HandleXxx` method on `*Deps` |
| `pkg/mcp/server.go` | Add a `mcp.AddTool(srv, ...)` entry to `registerTools` |
| `pkg/mcp/tools/tools_test.go` | Test using `mcptest.NewEnv` from `internal/mcptest` |
| `skills/remind/SKILL.md` *(read tools)* or `skills/memorize/SKILL.md` *(write tools)* | Add the new tool to the inventory and any pattern section it belongs in |
## Tool file template
The shape is uniform across `fetch.go`, `search.go`, `summarize.go`, `write.go`. Mirror it.
```go
package tools
import (
"context"
"fmt"
"time"
gomcp "github.com/modelcontextprotocol/go-sdk/mcp"
)
type ExampleInput struct {
Anchor string `json:"anchor" jsonschema:"Node ID to operate on"`
Budget int `json:"budget,omitempty" jsonschema:"Token budget for the response"`
}
func (d *Deps) HandleExample(ctx context.Context, _ *gomcp.CallToolRequest, input ExampleInput) (_ *gomcp.CallToolResult, _ any, err error) {
defer d.logCall("MemoryExample", &err, time.Now(), "anchor", input.Anchor, "budget", input.Budget)
// Write-side tools take the lock; read-side tools do