list_dataverse_publishers
Retrieve publishers from Dataverse to discover available publishers, find custom publishers for solution creation, or view publisher configurations with customization prefixes.
Instructions
Retrieves a list of publishers in the Dataverse environment with filtering options. Use this to discover available publishers, find custom publishers for solution creation, or get an overview of publisher configurations including customization prefixes.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| customOnly | No | Whether to list only custom publishers | |
| top | No | Maximum number of publishers to return |
Implementation Reference
- src/tools/solution-tools.ts:300-350 (handler)The main handler function for the 'list_dataverse_publishers' tool. It builds OData query parameters based on input (customOnly filter, top limit), fetches publishers from the Dataverse API, maps the response to a clean format, and returns a markdown-formatted list or error response.async (params) => { try { let queryParams: Record<string, any> = { $select: "friendlyname,uniquename,customizationprefix,customizationoptionvalueprefix,description,isreadonly" }; let filters: string[] = []; if (params.customOnly) { filters.push("isreadonly eq false"); } if (filters.length > 0) { queryParams.$filter = filters.join(" and "); } if (params.top) { queryParams.$top = params.top; } const result = await client.get('publishers', queryParams); const publisherList = result.value.map((publisher: any) => ({ friendlyName: publisher.friendlyname, uniqueName: publisher.uniquename, customizationPrefix: publisher.customizationprefix, customizationOptionValuePrefix: publisher.customizationoptionvalueprefix, description: publisher.description, isReadOnly: publisher.isreadonly })); return { content: [ { type: "text", text: `Found ${publisherList.length} publishers:\n\n${JSON.stringify(publisherList, null, 2)}` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error listing publishers: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } }
- src/tools/solution-tools.ts:295-298 (schema)Zod input schema defining parameters for the tool: customOnly (boolean, defaults to true for custom publishers only), top (optional number for pagination).inputSchema: { customOnly: z.boolean().default(true).describe("Whether to list only custom publishers"), top: z.number().optional().describe("Maximum number of publishers to return") }
- src/tools/solution-tools.ts:290-351 (registration)The server.registerTool call within listPublishersTool function that registers the 'list_dataverse_publishers' tool, including its title, description, input schema, and handler reference.server.registerTool( "list_dataverse_publishers", { title: "List Dataverse Publishers", description: "Retrieves a list of publishers in the Dataverse environment with filtering options. Use this to discover available publishers, find custom publishers for solution creation, or get an overview of publisher configurations including customization prefixes.", inputSchema: { customOnly: z.boolean().default(true).describe("Whether to list only custom publishers"), top: z.number().optional().describe("Maximum number of publishers to return") } }, async (params) => { try { let queryParams: Record<string, any> = { $select: "friendlyname,uniquename,customizationprefix,customizationoptionvalueprefix,description,isreadonly" }; let filters: string[] = []; if (params.customOnly) { filters.push("isreadonly eq false"); } if (filters.length > 0) { queryParams.$filter = filters.join(" and "); } if (params.top) { queryParams.$top = params.top; } const result = await client.get('publishers', queryParams); const publisherList = result.value.map((publisher: any) => ({ friendlyName: publisher.friendlyname, uniqueName: publisher.uniquename, customizationPrefix: publisher.customizationprefix, customizationOptionValuePrefix: publisher.customizationoptionvalueprefix, description: publisher.description, isReadOnly: publisher.isreadonly })); return { content: [ { type: "text", text: `Found ${publisherList.length} publishers:\n\n${JSON.stringify(publisherList, null, 2)}` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error listing publishers: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } } );
- src/index.ts:172-172 (registration)Invocation of listPublishersTool in the main index.ts file, which triggers the registration of the tool on the MCP server instance.listPublishersTool(server, dataverseClient);