get_user
Retrieve user information from Gitee by specifying a username. Use this tool to access user details for repository management or integration purposes.
Instructions
获取 Gitee 用户信息
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| username | Yes | Username |
Implementation Reference
- operations/users.ts:29-36 (handler)The main handler function that fetches the specified Gitee user's information using the API.export async function getUser(username: string) { username = validateOwnerName(username); const url = `/users/${username}`; const response = await giteeRequest(url, "GET"); return GiteeUserSchema.parse(response); }
- operations/users.ts:6-9 (schema)Zod schema defining the input parameters for the get_user tool (username).export const GetUserSchema = z.object({ // 用户名 username: z.string().describe("Username"), });
- index.ts:253-261 (registration)Registers the get_user tool with the MCP server, linking schema and handler.server.registerTool({ name: "get_user", description: "获取 Gitee 用户信息", schema: userOperations.GetUserSchema, handler: async (params: any) => { const { username } = params; return await userOperations.getUser(username); }, });