Documentation
¶
Index ¶
Constants ¶
View Source
const ( // GetMyUserInfoToolName is the unique tool name used for MCP registration and lookup of the get_my_user_info command. GetMyUserInfoToolName = "get_my_user_info" // GetUserOrgsToolName is the unique tool name used for MCP registration and lookup of the get_user_orgs command. GetUserOrgsToolName = "get_user_orgs" )
Variables ¶
View Source
var ( // GetMyUserInfoTool is the MCP tool for retrieving the current user's info. // It is registered with a specific name and a description string. GetMyUserInfoTool = mcp.NewTool( GetMyUserInfoToolName, mcp.WithDescription("Get my user info"), ) // GetUserOrgsTool is the MCP tool for listing organizations for the authenticated user. // It supports pagination via "page" and "pageSize" arguments with default values specified above. GetUserOrgsTool = mcp.NewTool( GetUserOrgsToolName, mcp.WithDescription("Get organizations associated with the authenticated user"), mcp.WithNumber("page", mcp.Description("page number"), mcp.DefaultNumber(defaultPage)), mcp.WithNumber("pageSize", mcp.Description("page size"), mcp.DefaultNumber(defaultPageSize)), ) )
View Source
var Tool = tool.New()
Tool is the MCP tool manager instance for registering all MCP tools in this package.
Functions ¶
func GetUserInfoFn ¶
func GetUserInfoFn(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error)
GetUserInfoFn is the handler for "get_my_user_info" MCP tool requests. Logs invocation, fetches current user info from gitea, wraps result for MCP.
func GetUserOrgsFn ¶ added in v0.1.9
func GetUserOrgsFn(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error)
GetUserOrgsFn is the handler for "get_user_orgs" MCP tool requests. Logs invocation, pulls validated pagination arguments from request, performs Gitea organization listing, and wraps the result for MCP.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.