Skip to main content
Glama
mwhesse

Dataverse MCP Server

by mwhesse

Clear Solution Context

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();
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and effectively discloses key behavioral traits: it describes the effect ('metadata operations will not be associated with any specific solution') and the state change after clearing. It doesn't mention error conditions or permissions, but provides sufficient context for a zero-parameter tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with zero waste: the first states the action and immediate effect, the second provides usage guidance. Every word earns its place and the information is front-loaded appropriately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter tool with no annotations and no output schema, the description provides complete context about what the tool does, when to use it, and the resulting state. It could mention if there's any confirmation or error handling, but is largely sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't discuss parameters since none exist, focusing instead on the tool's effect and usage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Clears') and resource ('currently active solution context'), distinguishing it from siblings like 'set_solution_context' and 'get_solution_context'. It precisely defines what the tool does without being tautological.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use the tool: 'when you want to work without a solution context or before switching to a different solution'. This provides clear context for usage versus alternatives like 'set_solution_context'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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