Skip to main content
Glama

get-github-user

Retrieve detailed GitHub user information by providing a username. This tool, part of the MCP-Server, integrates with external APIs to fetch and return user data for streamlined access and usage.

Instructions

根据用户名获取 Github 用户信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameNo

Implementation Reference

  • The asynchronous handler function for the 'get-github-user' tool. It takes a username, fetches user data from the GitHub API, and returns the data as a JSON string in the specified content format.
    async ({ username }) => { // 获取网格点数据的 URL const pointsUrl = `https://api.github.com/users/${username}`; const data: Root = await fetch(pointsUrl).then((response) => response.json(), ); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; },
  • The input schema for the 'get-github-user' tool, defined using Zod. It specifies an optional 'username' parameter of type string.
    { username: z.string().optional(), },
  • src/index.ts:77-102 (registration)
    The registration of the 'get-github-user' tool using McpServer's tool method, including name, description, input schema, and handler function.
    server.tool( // 工具名称 'get-github-user', // 工具描述 '根据用户名获取 Github 用户信息', // 工具参数 { username: z.string().optional(), }, // 工具的异步处理函数 async ({ username }) => { // 获取网格点数据的 URL const pointsUrl = `https://api.github.com/users/${username}`; const data: Root = await fetch(pointsUrl).then((response) => response.json(), ); return { content: [ { type: 'text', text: JSON.stringify(data), }, ], }; }, );

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/chenshuai2144/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server