set_autonumber_seed
Set the starting number for an AutoNumber column in Dataverse to control sequential numbering for future records in your table.
Instructions
Sets the seed value for an AutoNumber column's sequential segment using the SetAutoNumberSeed action. This controls the starting number for future records. Note: Seed values are environment-specific and not included in solutions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| columnLogicalName | Yes | Logical name of the AutoNumber column | |
| entityLogicalName | Yes | Logical name of the table containing the AutoNumber column | |
| seedValue | Yes | Next sequential number to use (e.g., 10000 to start from 10000) |
Implementation Reference
- src/tools/autonumber-tools.ts:247-292 (handler)The main handler implementation for the 'set_autonumber_seed' tool. It registers the tool with MCP server, defines the input schema, and executes the Dataverse 'SetAutoNumberSeed' action to set the sequential seed value.export function setAutoNumberSeedTool(server: McpServer, client: DataverseClient) { server.registerTool( 'set_autonumber_seed', { title: 'Set AutoNumber Seed', description: 'Sets the seed value for an AutoNumber column\'s sequential segment using the SetAutoNumberSeed action. This controls the starting number for future records. Note: Seed values are environment-specific and not included in solutions.', inputSchema: { entityLogicalName: z.string().describe('Logical name of the table containing the AutoNumber column'), columnLogicalName: z.string().describe('Logical name of the AutoNumber column'), seedValue: z.number().int().min(1).describe('Next sequential number to use (e.g., 10000 to start from 10000)') } }, async (params) => { try { // Use the SetAutoNumberSeed action const actionData = { "EntityLogicalName": params.entityLogicalName, "AttributeLogicalName": params.columnLogicalName, "Value": params.seedValue }; await client.post('SetAutoNumberSeed', actionData); return { content: [ { type: "text", text: `Successfully set AutoNumber seed for column '${params.columnLogicalName}' in table '${params.entityLogicalName}'.\n\nSeed Value: ${params.seedValue}\n\nNote: Seed value only affects future records and is environment-specific (not included in solutions).` } ] }; } catch (error: any) { return { content: [ { type: "text", text: `Error setting AutoNumber seed: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } } ); }
- Zod input schema defining parameters: entityLogicalName (string), columnLogicalName (string), seedValue (integer >=1).inputSchema: { entityLogicalName: z.string().describe('Logical name of the table containing the AutoNumber column'), columnLogicalName: z.string().describe('Logical name of the AutoNumber column'), seedValue: z.number().int().min(1).describe('Next sequential number to use (e.g., 10000 to start from 10000)') }
- src/index.ts:242-242 (registration)Invocation of setAutoNumberSeedTool which registers the 'set_autonumber_seed' tool with the MCP server.setAutoNumberSeedTool(server, dataverseClient);
- src/index.ts:100-106 (registration)Import of setAutoNumberSeedTool from autonumber-tools.js enabling its registration.createAutoNumberColumnTool, updateAutoNumberFormatTool, setAutoNumberSeedTool, getAutoNumberColumnTool, listAutoNumberColumnsTool, convertToAutoNumberTool } from "./tools/autonumber-tools.js";