25 lines
485 B
Go
25 lines
485 B
Go
package tools
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
|
|
"gitea.d-ma.be/mathias/gitea-mcp/internal/registry"
|
|
)
|
|
|
|
// Tool implements registry.Tool.
|
|
type Tool = registry.Tool
|
|
|
|
func textOK(v any) (json.RawMessage, error) {
|
|
return json.Marshal(v)
|
|
}
|
|
|
|
func parseArgs(raw json.RawMessage, dst any) error {
|
|
if len(raw) == 0 {
|
|
return json.Unmarshal([]byte("{}"), dst)
|
|
}
|
|
return json.Unmarshal(raw, dst)
|
|
}
|
|
|
|
func _ctx(ctx context.Context) context.Context { return ctx } // stub for future hooks
|