clear_solution_context
Remove the current solution context to work without solution association or prepare for switching to a different solution in Dataverse.
Instructions
Clears the currently active solution context. After clearing, metadata operations will not be associated with any specific solution. Use this when you want to work without a solution context or before switching to a different solution.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/solution-tools.ts:449-475 (handler)The MCP tool handler function that clears the solution context using the Dataverse client and returns a success or error message.async () => { try { const previousContext = client.getSolutionContext(); client.clearSolutionContext(); return { content: [ { type: "text", text: previousContext ? `Solution context cleared. Previously set to '${previousContext.solutionUniqueName}'. Metadata operations will no longer be associated with any specific solution.\n\n.dataverse-mcp file has been removed.` : "Solution context cleared (no context was previously set)." } ] }; } catch (error) { return { content: [ { type: "text", text: `Error clearing solution context: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } }
- src/tools/solution-tools.ts:444-448 (schema)Input/output schema definition for the clear_solution_context tool (empty input schema).{ title: "Clear Solution Context", description: "Clears the currently active solution context. After clearing, metadata operations will not be associated with any specific solution. Use this when you want to work without a solution context or before switching to a different solution.", inputSchema: {} },
- src/tools/solution-tools.ts:442-476 (registration)Registers the clear_solution_context tool with the MCP server, including name, schema, and handler.server.registerTool( "clear_solution_context", { title: "Clear Solution Context", description: "Clears the currently active solution context. After clearing, metadata operations will not be associated with any specific solution. Use this when you want to work without a solution context or before switching to a different solution.", inputSchema: {} }, async () => { try { const previousContext = client.getSolutionContext(); client.clearSolutionContext(); return { content: [ { type: "text", text: previousContext ? `Solution context cleared. Previously set to '${previousContext.solutionUniqueName}'. Metadata operations will no longer be associated with any specific solution.\n\n.dataverse-mcp file has been removed.` : "Solution context cleared (no context was previously set)." } ] }; } catch (error) { return { content: [ { type: "text", text: `Error clearing solution context: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } } );
- src/index.ts:177-177 (registration)Calls clearSolutionContextTool to perform the tool registration during server initialization.clearSolutionContextTool(server, dataverseClient);
- src/dataverse-client.ts:194-198 (helper)DataverseClient helper method that nullifies solution context properties and removes the .dataverse-mcp persistence file.clearSolutionContext(): void { this.solutionUniqueName = null; this.solutionContext = null; this.saveSolutionContext(); }