Skip to main content
Glama
jimpick

MCP JSON Document Collection Server

by jimpick

connect_json_doc_database_to_cloud

Connect a JSON document database to cloud sync for sharing and collaboration across devices.

Instructions

Connect a JSON document database to cloud sync service

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseNameNoname of document database to connect to cloud

Implementation Reference

  • The main handler for the 'connect_json_doc_database_to_cloud' tool. Validates input using ConnectDbToCloudArgsSchema, retrieves the database, connects it to the cloud using the 'connect' function from fireproof-cloud, extracts remoteName and dashboardUrl, updates the metadata, and returns a success message with the dashboard URL.
    case "connect_json_doc_database_to_cloud": {
      const parsed = ConnectDbToCloudArgsSchema.safeParse(args);
      if (!parsed.success) {
        throw new Error(`Invalid arguments for connect_json_doc_database_to_cloud: ${parsed.error}`);
      }
      const dbName = parsed.data.databaseName;
      const results = await localJsonDbCollection.query<string, JsonDocDb>(
        "name",
        {
          range: [
            dbName,
            dbName
          ]
        });
      if (results.rows.length != 1) {
        throw new Error(`Database not found: ${dbName}`);
      }
      const doc = results.rows[0].doc!;
      if (!dbs[dbName]) {
        const newDb = fireproof(dbName);
        dbs[dbName] = { db: newDb };
      }
      const db = dbs[dbName].db;
      const connection = await connect(db);
      const remoteName = connection.dashboardUrl?.getParam("remoteName");
      // console.error("connection.dashboardUrl.remoteName", connection.dashboardUrl?.getParam("remoteName"));
      const dashboardUrl = connection.dashboardUrl?.toString();
      // console.error("dashboardUrl", dashboardUrl);
      await localJsonDbCollection.put({...doc, remoteName, dashboardUrl});
    
      return {
        content: [
          {
            type: "text",
            text: `Connected JSON document database to cloud: ${dbName}, dashboard URL: ${dashboardUrl}`,
          }
        ]
      }
    }
  • Zod schema definition for the input arguments of the connect_json_doc_database_to_cloud tool, requiring a 'databaseName' string.
    const ConnectDbToCloudArgsSchema = z.object({
      databaseName: z.string(),
    });
  • src/index.ts:111-116 (registration)
    Tool registration in the ListToolsRequestHandler, including name, description, input schema derived from ConnectDbToCloudArgsSchema, and required fields.
    {
      name: "connect_json_doc_database_to_cloud",
      description: "Connect a JSON document database to cloud sync service. Show the dashboard URL after connecting.",
      inputSchema: zodToJsonSchema(ConnectDbToCloudArgsSchema) as ToolInput,
      required: ["databaseName"],
    },
  • src/index.ts:189-201 (registration)
    Duplicate tool registration in ListToolsRequestHandler with inline input schema.
    {
      name: "connect_json_doc_database_to_cloud",
      description: "Connect a JSON document database to cloud sync service",
      inputSchema: {
        type: "object",
        properties: {
          databaseName: {
            type: "string",
            description: "name of document database to connect to cloud",
          },
        }
      },
    },
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 action ('connect') but lacks details on what this entails—such as whether it's a one-time setup, requires authentication, involves data migration, or has side effects like enabling cloud access. This leaves key behavioral traits unspecified for a mutation 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?

The description is a single, efficient sentence that directly states the tool's purpose without any fluff or redundancy. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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

Completeness3/5

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

Given the tool's complexity (a mutation operation with no annotations and no output schema), the description is minimally adequate. It states what the tool does but lacks details on behavior, usage context, or outcomes, leaving gaps that could hinder an agent's ability to invoke it correctly without additional context.

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 input schema has 100% description coverage, with the parameter 'databaseName' clearly documented. The description doesn't add extra meaning beyond the schema, but with only one parameter and high schema coverage, the baseline is strong. A score of 4 reflects that the description doesn't detract from the schema's clarity, though it doesn't enhance it either.

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 ('connect') and the resource ('JSON document database to cloud sync service'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'create_json_doc_database' or 'list_json_doc_databases', which would require more specific context about what 'connect' entails versus creation or listing.

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. For example, it doesn't specify prerequisites (e.g., whether the database must exist from 'create_json_doc_database'), exclusions, or comparisons to siblings like 'save_json_doc_to_db', leaving the agent to infer usage from context alone.

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/jimpick/mcp-json-db-collection-server'

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