Skip to main content
Glama

tauri_ipc_get_backend_state

Read-only

Retrieve backend state information from Tauri applications, including app metadata, Tauri version, and environment details to verify connectivity and gather application information.

Instructions

[Tauri Apps Only] Get Tauri backend state: app metadata, Tauri version, environment. Requires active tauri_driver_session. Use to verify you're connected to a Tauri app and get app info.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appIdentifierNoApp port or bundle ID to target. Defaults to the only connected app or the default app if multiple are connected.

Implementation Reference

  • Core handler function that executes the tool logic by sending an IPC command 'plugin:mcp-bridge|get_backend_state' to the Tauri app via the MCP bridge plugin client.
    export async function getBackendState(options: {
       useExistingClient?: boolean;
       appIdentifier?: string | number;
    } = {}): Promise<string> {
       try {
          const { useExistingClient = false, appIdentifier } = options;
    
          if (useExistingClient) {
             // During session setup, use the already-connected client directly
             const client = getExistingPluginClient();
    
             if (!client || !client.isConnected()) {
                throw new Error('No connected client available');
             }
    
             const response = await client.sendCommand({
                command: 'invoke_tauri',
                args: { command: 'plugin:mcp-bridge|get_backend_state', args: {} },
             });
    
             if (!response.success) {
                throw new Error(response.error || 'Unknown error');
             }
    
             return JSON.stringify(response.data);
          }
    
          // Normal mode: use executeIPCCommand which validates session
          const result = await executeIPCCommand({ command: 'plugin:mcp-bridge|get_backend_state', appIdentifier });
    
          const parsed = JSON.parse(result);
    
          if (!parsed.success) {
             throw new Error(parsed.error || 'Unknown error');
          }
    
          return JSON.stringify(parsed.result);
       } catch(error: unknown) {
          const message = error instanceof Error ? error.message : String(error);
    
          throw new Error(`Failed to get backend state: ${message}`);
       }
    }
  • Zod schema for validating the tool's input parameters, specifically the optional appIdentifier.
    export const GetBackendStateSchema = z.object({
       appIdentifier: z.union([ z.string(), z.number() ]).optional().describe(
          'App port or bundle ID to target. Defaults to the only connected app or the default app if multiple are connected.'
       ),
    });
  • Tool registration in the central TOOLS array, defining name, description, category, schema reference, annotations, and thin wrapper handler that parses args and delegates to getBackendState.
    {
       name: 'tauri_ipc_get_backend_state',
       description:
          '[Tauri Apps Only] Get Tauri backend state: app metadata, Tauri version, environment. ' +
          'Requires active tauri_driver_session. ' +
          'Use to verify you\'re connected to a Tauri app and get app info.',
       category: TOOL_CATEGORIES.IPC_PLUGIN,
       schema: GetBackendStateSchema,
       annotations: {
          title: 'Get Tauri Backend State',
          readOnlyHint: true,
          openWorldHint: false,
       },
       handler: async (args) => {
          const parsed = GetBackendStateSchema.parse(args);
    
          return await getBackendState({ appIdentifier: parsed.appIdentifier });
       },
    },
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, indicating this is a safe, read-only operation with limited scope. The description adds valuable context beyond this by specifying the prerequisite (active session) and the purpose (verification and info retrieval), which helps the agent understand when and why to use it. No contradictions with annotations are present.

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 front-loaded with the core purpose, followed by prerequisites and usage guidance in just two sentences. Every sentence adds value: the first defines the tool, and the second provides critical context for correct invocation. There is no wasted text or redundancy.

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?

Given the tool's low complexity (one optional parameter, read-only operation) and the absence of an output schema, the description is nearly complete. It covers purpose, prerequisites, and usage context effectively. A minor gap is the lack of details on return values (e.g., structure of app metadata), but this is mitigated by the tool's simplicity and the annotations providing safety context.

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%, with the single parameter 'appIdentifier' well-documented in the schema. The description does not add any parameter-specific details beyond what the schema provides, such as examples or edge cases. However, with high schema coverage and only one parameter, the baseline score of 3 is appropriate.

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 ('Get Tauri backend state') and resource ('app metadata, Tauri version, environment'), distinguishing it from siblings like tauri_ipc_execute_command or tauri_webview_execute_js. It explicitly notes this is for '[Tauri Apps Only]', which helps differentiate from non-Tauri tools.

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?

The description provides explicit usage guidance: it states when to use ('Use to verify you're connected to a Tauri app and get app info') and includes a prerequisite ('Requires active tauri_driver_session'). This clearly distinguishes it from tools like tauri_list_devices or tauri_get_setup_instructions that don't require an active session.

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/hypothesi/mcp-server-tauri'

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