Skip to main content
Glama
ddukbg

GitHub Enterprise MCP Server

update-user

Modify user profile details on GitHub Enterprise, including email, name, company, location, bio, blog, and Twitter username, via the GitHub Enterprise MCP Server integration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bioNoBiography for the user
blogNoURL of the user's blog or website
companyNoCompany for the user
emailNoThe email address for the user
locationNoLocation for the user
nameNoFull name for the user
twitter_usernameNoTwitter username for the user
usernameYesUsername of the user to update

Implementation Reference

  • MCP tool registration for 'update-user', including inline handler that delegates to UserManagement.updateUser and zod input schema validation.
    server.tool( "update-user", { username: z.string().describe("Username of the user to update"), email: z.string().optional().describe("The email address for the user"), name: z.string().optional().describe("Full name for the user"), company: z.string().optional().describe("Company for the user"), location: z.string().optional().describe("Location for the user"), bio: z.string().optional().describe("Biography for the user"), blog: z.string().optional().describe("URL of the user's blog or website"), twitter_username: z.string().optional().describe("Twitter username for the user") }, async ({ username, email, name, company, location, bio, blog, twitter_username }) => { try { if (!context.isGitHubEnterprise) { return { content: [ { type: "text", text: "User updates are only available in GitHub Enterprise. This operation cannot be performed on GitHub.com." } ], isError: true }; } const user = await context.users.updateUser(context.client, { username, email, name, company, location, bio, blog, twitter_username }); return { content: [ { type: "text", text: `User '${username}' successfully updated:\n\n${JSON.stringify(user, null, 2)}` } ] }; } catch (error: any) { console.error('Error updating user:', error); return { content: [ { type: "text", text: `An error occurred while updating user: ${error.message}` } ], isError: true }; } } );
  • Core handler function in UserManagement class that performs the actual GitHub API PATCH request to update user via /admin/users/{username} endpoint.
    async updateUser(client: any, params: UpdateUserParams): Promise<User> { try { const { baseUrl, token } = client; const { username, ...userData } = params; if (!username) { throw new Error('Username is required'); } const url = `${baseUrl}/admin/users/${username}`; const response = await axios.patch(url, userData, { headers: { Authorization: `token ${token}`, Accept: 'application/vnd.github.v3+json', 'Content-Type': 'application/json' } }); return response.data; } catch (error: any) { if (error.response?.status === 404) { throw new Error(`User '${params.username}' not found or admin endpoint not available`); } else if (error.response?.status === 422) { throw new Error(`Validation failed: ${error.response.data.message || 'Check the provided data format'}`); } throw new Error(`Failed to update user: ${error.message}`); } }
  • TypeScript interface defining input parameters for updating a user, extending CreateUserParams partially with required username.
    export interface UpdateUserParams extends Partial<CreateUserParams> { /** * Username of the user to update */ username: string; }

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/ddukbg/github-enterprise-mcp'

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