tools

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2026 License: ISC Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatResponse

func FormatResponse(data []byte, client *strava.Client) *mcp.CallToolResult

FormatResponse pretty-prints raw JSON data with 2-space indentation and conditionally appends a rate limit warning when API usage exceeds 80%. If the data is not valid JSON, returns the raw string as-is.

func HandleCheckUpdate added in v1.2.0

func HandleCheckUpdate(checker *update.Checker) server.ToolHandlerFunc

HandleCheckUpdate returns a handler for the strava_check_update tool.

func HandleCreateActivity

func HandleCreateActivity(client *strava.Client) server.ToolHandlerFunc

HandleCreateActivity returns a handler for the create_activity tool.

func HandleCreateUpload

func HandleCreateUpload(client *strava.Client) server.ToolHandlerFunc

HandleCreateUpload returns a handler for the create_upload tool.

func HandleGetActivities

func HandleGetActivities(client *strava.Client) server.ToolHandlerFunc

HandleGetActivities returns a handler for the get_activities tool.

func HandleGetActivityById

func HandleGetActivityById(client *strava.Client) server.ToolHandlerFunc

HandleGetActivityById returns a handler for the get_activity_by_id tool.

func HandleGetActivityStreams

func HandleGetActivityStreams(client *strava.Client) server.ToolHandlerFunc

HandleGetActivityStreams returns a handler for the get_activity_streams tool.

func HandleGetActivityZones

func HandleGetActivityZones(client *strava.Client) server.ToolHandlerFunc

HandleGetActivityZones returns a handler for the get_activity_zones tool.

func HandleGetAthlete

func HandleGetAthlete(client *strava.Client) server.ToolHandlerFunc

HandleGetAthlete returns a handler for the get_athlete tool.

func HandleGetAthleteStats

func HandleGetAthleteStats(client *strava.Client) server.ToolHandlerFunc

HandleGetAthleteStats returns a handler for the get_athlete_stats tool. When id is omitted (0), auto-fetches the authenticated athlete's ID first.

func HandleGetClubActivities

func HandleGetClubActivities(client *strava.Client) server.ToolHandlerFunc

HandleGetClubActivities returns a handler for the get_club_activities tool.

func HandleGetUpload

func HandleGetUpload(client *strava.Client) server.ToolHandlerFunc

HandleGetUpload returns a handler for the get_upload tool.

func HandleSelfUpdate added in v1.2.0

func HandleSelfUpdate(checker *update.Checker, updater *update.Updater) server.ToolHandlerFunc

HandleSelfUpdate returns a handler for the strava_self_update tool. CRITICAL: This handler never calls os.Exit(). The MCP response must be sent before any process state changes.

func HandleToolError

func HandleToolError(toolName string, err error) *mcp.CallToolResult

HandleToolError formats an error into an MCP error result. If the error is a StravaError, includes the HTTP status code and response body. Otherwise, includes the raw error message.

func HandleUpdateActivity

func HandleUpdateActivity(client *strava.Client) server.ToolHandlerFunc

HandleUpdateActivity returns a handler for the update_activity tool. CRITICAL: Only sends user-provided fields to avoid zero-value overwrite.

func RegisterAll

func RegisterAll(s *server.MCPServer, client *strava.Client)

RegisterAll registers all MCP tools with the server.

func RegisterUpdateTools added in v1.2.0

func RegisterUpdateTools(s *server.MCPServer, checker *update.Checker, updater *update.Updater)

RegisterUpdateTools registers the update MCP tools with the server. If checker or updater is nil, the corresponding tools are not registered. This is called separately from RegisterAll because update tools depend on *update.Checker/*update.Updater, not *strava.Client.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL