netlify-user-services
Retrieve user data from Netlify by executing the 'get-user' operation through the Model Context Protocol, enabling integration with code agents for automating user management tasks.
Instructions
Select and run one of the following Netlify operations get-user
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selectSchema | Yes |
Implementation Reference
- src/tools/user-tools/get-user.ts:15-17 (handler)Executes the core logic of the 'get-user' operation by fetching user data from the Netlify '/api/v1/user' endpoint using getAPIJSONResult helper.cb: async (_, {request}) => { return JSON.stringify(await getAPIJSONResult('/api/v1/user', {}, {}, request)); }
- src/tools/user-tools/get-user.ts:6-6 (schema)Zod input schema for the get-user tool, which requires no parameters.const getUserParamsSchema = z.object({});
- src/tools/index.ts:144-154 (registration)Registers the grouped tool 'netlify-user-services-reader' (since user domain has only read tools) that dispatches to specific user operations like get-user.const friendlyOperationType = operationType === 'read' ? 'reader' : 'updater'; const toolName = `netlify-${domain}-services-${friendlyOperationType}`; const toolDescription = `Select and run one of the following Netlify ${operationType} operations${readOnlyIndicator} ${toolOperations.join(', ')}`; server.registerTool(toolName, { description: toolDescription, inputSchema: paramsSchema, annotations: { readOnlyHint: operationType === 'read' } }, async (...args) => {
- src/tools/user-tools/index.ts:4-4 (registration)Registers the individual 'getUserDomainTool' into the userDomainTools array used by bindTools.export const userDomainTools = [getUserDomainTool]
- src/utils/api-networking.ts:142-142 (helper)Helper function used by the handler to make authenticated API calls to Netlify and return JSON results.export const getAPIJSONResult = async (urlOrPath: string, options: RequestInit = {}, apiInteractionOptions: APIInteractionOptions = {}, incomingRequest?: Request): Promise<any> => {