Skip to main content
Glama

project_save

Save the currently opened project in the Visum Thinker MCP Server to preserve work and prevent data loss. Optionally save with a different filename for version control.

Instructions

Save the currently opened project in its TCP server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject ID to save
saveAsNoOptional: Save with a different filename

Implementation Reference

  • MCP tool registration for 'project_save', including inline Zod schema for parameters and the handler function that delegates to ProjectServerManager.saveProject.
      "project_save",
      "Save the currently opened project in its TCP server",
      {
        projectId: z.string().describe("Project ID to save"),
        saveAs: z.string().optional().describe("Optional: Save with a different filename")
      },
      async ({ projectId, saveAs }) => {
        try {
          const result = await serverManager.saveProject(projectId, saveAs);
          
          if (result.success) {
            return {
              content: [
                {
                  type: "text",
                  text: `šŸ’¾ **Progetto Salvato**\n\nāœ… ${result.message}${saveAs ? `\n\nšŸ“ Salvato come: ${saveAs}` : ''}`
                }
              ]
            };
          } else {
            return {
              content: [
                {
                  type: "text",
                  text: `āŒ **Errore Salvataggio**\n\n${result.message || result.error}`
                }
              ]
            };
          }
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `āŒ **Errore:** ${error instanceof Error ? error.message : String(error)}`
              }
            ]
          };
        }
      }
    );
  • Handler logic in ProjectServerManager.saveProject that retrieves server info and sends a TCP command {type: 'save_project', saveAs} to the project-specific TCP server process for executing the save operation.
    async saveProject(projectId: string, saveAs: string | null = null): Promise<any> {
      const serverInfo = this.activeServers.get(projectId);
      if (!serverInfo) {
        return {
          success: false,
          message: 'Progetto non trovato'
        };
      }
    
      // Invia comando di salvataggio al server TCP
      return await this.sendCommandToServer(projectId, {
        type: 'save_project',
        saveAs: saveAs
      });
    }
  • Helper method sendCommandToServer that establishes TCP connection to project server, sends the 'save_project' command as JSON, and parses the response from the server.
    async sendCommandToServer(projectId: string, command: any): Promise<any> {
      const serverInfo = this.activeServers.get(projectId);
      if (!serverInfo) {
        throw new Error('Server progetto non trovato');
      }
    
      return new Promise((resolve, reject) => {
        const client = createConnection(serverInfo.port, 'localhost');
        let buffer = '';
        
        client.on('connect', () => {
          const message = JSON.stringify({ ...command, requestId: Date.now() });
          client.write(message + '\n');
        });
    
        client.on('data', (data: any) => {
          buffer += data.toString();
          
          // Dividi per newlines per separare i messaggi
          const messages = buffer.split('\n');
          buffer = messages.pop() || ''; // Mantieni l'ultimo pezzo (potrebbe essere incompleto)
          
          for (const message of messages) {
            if (message.trim()) {
              try {
                // Rimuovi backslash-n letterali che il server TCP Python aggiunge
                const cleanedResponse = message.replace(/\\n$/g, '');
                const response = JSON.parse(cleanedResponse);
                
                // Ignora il messaggio di welcome, aspetta la risposta vera
                if (response.type === 'project_welcome') {
                  continue;
                }
                
                // Risposta al comando ricevuta (query_result, save_result, error, etc.)
                if (response.type === 'query_result' || response.type === 'save_result' || 
                    response.type === 'error' || response.type === 'shutdown_ack' ||
                    response.result !== undefined) {
                  client.end();
                  resolve(response);
                  return;
                }
              } catch (error) {
                // Ignora messaggi malformati, continua ad aspettare
                console.error('WARN: Messaggio TCP non parsabile:', message);
              }
            }
          }
        });
    
        client.on('error', (error: any) => {
          reject(error);
        });
    
        setTimeout(() => {
          client.end();
          reject(new Error('Timeout comando server'));
        }, 300000); // 5 minuti timeout per operazioni pesanti su reti grandi
      });
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool saves a project but doesn't explain what 'save' entails (e.g., overwrites existing data, requires permissions, has side effects like closing the project, or handles errors). For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action ('Save'), making it easy to parse. Every part of the sentence contributes to understanding the tool's function, with zero waste.

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

Completeness2/5

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

Given the complexity of a project save operation (a mutation with potential side effects), no annotations, and no output schema, the description is incomplete. It lacks details on behavior, error handling, or what 'save' means in this context (e.g., does it persist changes to a server or file?). For a tool with 2 parameters and significant implications, more context is needed to guide safe and effective use.

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

Parameters3/5

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

Schema description coverage is 100%, so the input schema fully documents both parameters ('projectId' and 'saveAs'). The description doesn't add any meaning beyond this, such as clarifying the scope of 'saveAs' (e.g., if it creates a new project or renames the current one). Given the high schema coverage, a baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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

Purpose4/5

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

The description clearly states the action ('Save') and target ('currently opened project in its TCP server'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'project_export_all_tables' or 'project_close', which also involve project operations, leaving room for ambiguity about when to choose this specific save function.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., a project must be open), exclusions, or comparisons to siblings like 'project_export_all_tables' for saving to files. This lack of context makes it unclear when this is the appropriate choice among related project tools.

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/multiluca2020/visum-thinker-mcp-server'

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