get_solution_context
Check which solution is currently active for metadata operations and verify the customization prefix being used for new components in Dataverse.
Instructions
Retrieves the currently active solution context information. Use this to check which solution is currently set for metadata operations and to verify the customization prefix being used for new components.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/solution-tools.ts:395-439 (handler)The getSolutionContextTool function implements and registers the 'get_solution_context' MCP tool. It defines the tool schema (empty input) and the handler logic that calls client.getSolutionContext() to retrieve the current solution context and formats it into a response.export function getSolutionContextTool(server: McpServer, client: DataverseClient) { server.registerTool( "get_solution_context", { title: "Get Solution Context", description: "Retrieves the currently active solution context information. Use this to check which solution is currently set for metadata operations and to verify the customization prefix being used for new components.", inputSchema: {} }, async () => { try { const currentContext = client.getSolutionContext(); if (!currentContext) { return { content: [ { type: "text", text: "No solution context is currently set. Metadata operations will not be associated with any specific solution." } ] }; } return { content: [ { type: "text", text: `Current solution context: '${currentContext.solutionUniqueName}' (${currentContext.solutionDisplayName})\n\nPublisher: ${currentContext.publisherDisplayName} (${currentContext.publisherUniqueName})\nPrefix: ${currentContext.customizationPrefix}\n\nAll metadata operations will be associated with this solution.\nLast updated: ${currentContext.lastUpdated}` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error getting solution context: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } } ); }
- src/index.ts:176-176 (registration)Invocation of getSolutionContextTool to register the tool with the MCP server during initialization.getSolutionContextTool(server, dataverseClient);
- src/dataverse-client.ts:186-188 (helper)Core helper method in DataverseClient that returns the persisted SolutionContext or null if none set.getSolutionContext(): SolutionContext | null { return this.solutionContext; }
- src/dataverse-client.ts:31-38 (schema)TypeScript interface defining the structure of SolutionContext returned by getSolutionContext() and used in tool responses.export interface SolutionContext { solutionUniqueName: string; solutionDisplayName?: string; publisherUniqueName?: string; publisherDisplayName?: string; customizationPrefix?: string; lastUpdated: string; }