Skip to main content
Glama
jimpick

MCP JSON Document Collection Server

by jimpick

connect_json_doc_database_to_cloud

Sync a JSON document database with cloud services to enable sharing and access across platforms using the MCP JSON Document Collection Server.

Instructions

Connect a JSON document database to cloud sync service

Input Schema

NameRequiredDescriptionDefault
databaseNameNoname of document database to connect to cloud

Input Schema (JSON Schema)

{ "properties": { "databaseName": { "description": "name of document database to connect to cloud", "type": "string" } }, "type": "object" }

Implementation Reference

  • Handler for the 'connect_json_doc_database_to_cloud' tool. Validates input using ConnectDbToCloudArgsSchema, checks if database exists in localJsonDbCollection, loads or creates the Fireproof DB, calls connect(db) from fireproof-cloud, extracts remoteName and dashboardUrl, updates the local collection with this info, 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 for input validation of the connect_json_doc_database_to_cloud tool, requiring a 'databaseName' string. Used in handler and one registration.
    const ConnectDbToCloudArgsSchema = z.object({ databaseName: z.string(), });
  • src/index.ts:111-116 (registration)
    Tool registration in the ListTools response, including name, description, inputSchema 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 the ListTools response with inline inputSchema (no zod reference).
    { 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", }, } }, },

Other Tools

Related 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