create_account
Create an account with name, email, phone, address, labels, and signup answers.
Instructions
Create an account
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Arbitrary string representing the name of the account. Is autogenerated for personal accounts. | |
| No | A string representing the billing e-mail of the account | ||
| phone | No | A string representing the phone number of the account | |
| label_ids | No | IDs of the labels | |
| custom | No | The custom properties of the account. | |
| address_attributes | No | ||
| signup_answers_attributes | No |
Implementation Reference
- src/tools/accounts.ts:102-110 (handler)Handler function for the create_account tool. Calls apiPost('/accounts', body) to create an account via the Eduframe API, logs the response, and returns a formatted success message.
async (body) => { try { const record = await apiPost<EduframeRecord>("/accounts", body); void logResponse("create_account", body, record); return formatCreate(record, "account"); } catch (error) { return formatError(error); } }, - src/tools/accounts.ts:68-100 (schema)Input schema for create_account tool defined using Zod, including fields: name (required), email, phone, label_ids, custom, address_attributes (with nested fields), and signup_answers_attributes.
{ description: "Create an account", annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false }, inputSchema: { name: z .string() .describe("Arbitrary string representing the name of the account. Is autogenerated for personal accounts."), email: z.string().optional().describe("A string representing the billing e-mail of the account"), phone: z.string().optional().describe("A string representing the phone number of the account"), label_ids: z.array(z.number().int()).optional().describe("IDs of the labels"), custom: z.object({}).optional().describe("The custom properties of the account."), address_attributes: z .object({ addressee: z.string().optional().describe("The addressee of the address."), address: z.string().describe("Concatenation of the street and house number."), address_line2: z.string().optional().describe("A string representing the second line of the address."), postal_code: z.string().describe("A string representing the postal code."), city: z.string().describe("A string representing the city."), state_province: z.string().optional().describe("An letter USA state code."), country: z.string().describe("An ISO3166 two-letter country code."), }) .optional(), signup_answers_attributes: z .array( z.object({ signup_question_id: z.number().int().describe("Unique identifier of the question."), value: z .union([z.string(), z.boolean(), z.array(z.string())]) .describe("The formatted value of the answer."), }), ) .optional(), }, - src/tools/accounts.ts:66-111 (registration)Registration of the create_account tool via server.registerTool() within the registerAccountTools function.
server.registerTool( "create_account", { description: "Create an account", annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false }, inputSchema: { name: z .string() .describe("Arbitrary string representing the name of the account. Is autogenerated for personal accounts."), email: z.string().optional().describe("A string representing the billing e-mail of the account"), phone: z.string().optional().describe("A string representing the phone number of the account"), label_ids: z.array(z.number().int()).optional().describe("IDs of the labels"), custom: z.object({}).optional().describe("The custom properties of the account."), address_attributes: z .object({ addressee: z.string().optional().describe("The addressee of the address."), address: z.string().describe("Concatenation of the street and house number."), address_line2: z.string().optional().describe("A string representing the second line of the address."), postal_code: z.string().describe("A string representing the postal code."), city: z.string().describe("A string representing the city."), state_province: z.string().optional().describe("An letter USA state code."), country: z.string().describe("An ISO3166 two-letter country code."), }) .optional(), signup_answers_attributes: z .array( z.object({ signup_question_id: z.number().int().describe("Unique identifier of the question."), value: z .union([z.string(), z.boolean(), z.array(z.string())]) .describe("The formatted value of the answer."), }), ) .optional(), }, }, async (body) => { try { const record = await apiPost<EduframeRecord>("/accounts", body); void logResponse("create_account", body, record); return formatCreate(record, "account"); } catch (error) { return formatError(error); } }, ); - src/tools/index.ts:64-65 (registration)registerAccountTools is included in the tools array and called by registerAllTools to register all tools on the MCP server.
const tools: Array<(server: McpServer) => void> = [ registerAccountTools, - src/api.ts:163-174 (helper)apiPost helper function used by the create_account handler to POST JSON data to the Eduframe API.
export async function apiPost<T>(path: string, body: unknown): Promise<T> { const { token } = getConfig(); const url = buildUrl(path); const response = await fetch(url.toString(), { method: "POST", headers: buildHeaders(token), body: JSON.stringify(body), }); return handleResponse<T>(response); }