create_authentication
Creates an authentication record for a user by linking a login identifier, user ID, and authentication provider type such as Azure AD or OpenID Connect.
Instructions
Create an authentication.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | Login identifier. | |
| user_id | Yes | Identifier of the associated User. | |
| authentication_provider_type | Yes | Type of the associated AuthenticationProvider. |
Implementation Reference
- src/tools/authentications.ts:62-70 (handler)The handler function that executes the create_authentication tool logic. It calls apiPost to POST /authentications with the body (uid, user_id, authentication_provider_type), logs the response, and formats the result using formatCreate.
async (body) => { try { const record = await apiPost<EduframeRecord>("/authentications", body); void logResponse("create_authentication", body, record); return formatCreate(record, "authentication"); } catch (error) { return formatError(error); } }, - src/tools/authentications.ts:51-61 (schema)Input schema definition for create_authentication. Defines required fields: uid (string), user_id (number), and authentication_provider_type (enum: azure_active_directory, eduframe, openid_connect, surf_conext). Uses Zod for validation.
{ description: "Create an authentication.", annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false }, inputSchema: { uid: z.string().describe("Login identifier."), user_id: z.number().int().describe("Identifier of the associated User."), authentication_provider_type: authenticationAuthenticationProviderTypeEnum.describe( "Type of the associated AuthenticationProvider.", ), }, }, - src/tools/authentications.ts:49-71 (registration)Registration of create_authentication via server.registerTool() with the tool name, schema, description, annotations (non-readonly, non-destructive, non-idempotent), and handler.
server.registerTool( "create_authentication", { description: "Create an authentication.", annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false }, inputSchema: { uid: z.string().describe("Login identifier."), user_id: z.number().int().describe("Identifier of the associated User."), authentication_provider_type: authenticationAuthenticationProviderTypeEnum.describe( "Type of the associated AuthenticationProvider.", ), }, }, async (body) => { try { const record = await apiPost<EduframeRecord>("/authentications", body); void logResponse("create_authentication", body, record); return formatCreate(record, "authentication"); } catch (error) { return formatError(error); } }, ); - src/tools/authentications.ts:7-12 (helper)The authenticationAuthenticationProviderTypeEnum Zod enum used as the type for the authentication_provider_type input field.
const authenticationAuthenticationProviderTypeEnum = z.enum([ "azure_active_directory", "eduframe", "openid_connect", "surf_conext", ]);