Skip to main content
Glama
mwhesse

Dataverse MCP Server

by mwhesse

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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 }; } }
  • 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: {} },
  • 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);
  • 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(); }

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mwhesse/mcp-dataverse'

If you have feedback or need assistance with the MCP directory API, please join our Discord server