Skip to main content
Glama

create_system_json

Generate a structured system JSON file to store and organize searchable data, instructions, or workflows for any domain. Includes name, domain, description, data, and optional tags for clarity and searchability.

Instructions

Create a new system JSON file for storing coherent detailed searchable data or instructions and workflows for any domain or action.

Parameters:

  • name: Name for the system JSON file (required) - alphanumeric, underscore, hyphen only

  • domain: Domain or category for the data (required)

  • description: Description of what this system JSON contains (required)

  • data: The structured data to store (required) - can be any JSON-serializable object

  • tags: Optional array of tags for searchability

Returns success status and confirmation message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesThe structured data to store
descriptionYesDescription of what this system JSON contains
domainYesDomain or category for the data
nameYesName for the system JSON file (alphanumeric, underscore, hyphen only)
tagsNoOptional array of tags for searchability

Implementation Reference

  • Core implementation in SystemJSON class that validates inputs, creates searchable content, performs atomic file write for the system JSON file.
    async createSystemJSON( name: string, domain: string, description: string, data: Record<string, unknown>, tags: string[] = [] ): Promise<{ success: boolean; message: string }> { try { // Validate name (alphanumeric, underscore, hyphen only) if (!/^[a-zA-Z0-9_-]+$/.test(name)) { return { success: false, message: 'Name must contain only letters, numbers, underscores, and hyphens' }; } const fileName = `${name}.json`; const filePath = path.join(this.systemJsonPath, fileName); // Check if file already exists try { await fs.access(filePath); return { success: false, message: `System JSON "${name}" already exists` }; } catch { // File doesn't exist, which is what we want } // Create searchable content from data const searchable_content = this.createSearchableContent(data, description, tags); const systemData: SystemJSONData = { name, domain, description, data, searchable_content, tags, created: Date.now(), modified: Date.now() }; // Atomic write const tempPath = path.join(this.systemJsonPath, `${fileName}.tmp`); const jsonContent = JSON.stringify(systemData, null, 2); await fs.writeFile(tempPath, jsonContent, 'utf-8'); // Validate JSON before committing try { JSON.parse(jsonContent); await fs.rename(tempPath, filePath); } catch (parseError) { await fs.unlink(tempPath).catch(() => {}); throw new Error(`JSON validation failed: ${parseError}`); } return { success: true, message: `Created system JSON: ${name}` }; } catch (error) { return { success: false, message: `Failed to create system JSON: ${error}` }; } }
  • Wrapper method in AdvancedReasoningServer that calls the core SystemJSON.createSystemJSON and formats the MCP-compliant response.
    public async createSystemJSON( name: string, domain: string, description: string, data: Record<string, unknown>, tags: string[] = [] ): Promise<{ content: Array<{ type: string; text: string }>; isError?: boolean }> { try { const result = await this.systemJson.createSystemJSON(name, domain, description, data, tags); return { content: [{ type: "text", text: JSON.stringify({ name, domain, description, success: result.success, message: result.message, tags, created: Date.now() }, null, 2) }], isError: !result.success }; } catch (error) { return { content: [{ type: "text", text: JSON.stringify({ error: error instanceof Error ? error.message : String(error), status: 'failed' }, null, 2) }], isError: true }; } }
  • Dispatch logic in the MCP CallToolRequestSchema handler switch statement that routes tool calls to the reasoningServer method.
    case "create_system_json": const { name: sysJsonName, domain, description, data, tags } = args as { name: string; domain: string; description: string; data: Record<string, unknown>; tags?: string[] }; return await reasoningServer.createSystemJSON(sysJsonName, domain, description, data, tags);
  • MCP Tool definition including name, description, and input schema validation.
    const CREATE_SYSTEM_JSON_TOOL: Tool = { name: "create_system_json", description: `Create a new system JSON file for storing coherent detailed searchable data or instructions and workflows for any domain or action. Parameters: - name: Name for the system JSON file (required) - alphanumeric, underscore, hyphen only - domain: Domain or category for the data (required) - description: Description of what this system JSON contains (required) - data: The structured data to store (required) - can be any JSON-serializable object - tags: Optional array of tags for searchability Returns success status and confirmation message.`, inputSchema: { type: "object", properties: { name: { type: "string", description: "Name for the system JSON file (alphanumeric, underscore, hyphen only)" }, domain: { type: "string", description: "Domain or category for the data" }, description: { type: "string", description: "Description of what this system JSON contains" }, data: { type: "object", description: "The structured data to store" }, tags: { type: "array", items: { type: "string" }, description: "Optional array of tags for searchability" } }, required: ["name", "domain", "description", "data"] } };
  • src/index.ts:1302-1315 (registration)
    Registration of the create_system_json tool (via CREATE_SYSTEM_JSON_TOOL) in the ListToolsRequestSchema handler, making it discoverable by MCP clients.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ ADVANCED_REASONING_TOOL, QUERY_MEMORY_TOOL, CREATE_LIBRARY_TOOL, LIST_LIBRARIES_TOOL, SWITCH_LIBRARY_TOOL, GET_LIBRARY_INFO_TOOL, CREATE_SYSTEM_JSON_TOOL, GET_SYSTEM_JSON_TOOL, SEARCH_SYSTEM_JSON_TOOL, LIST_SYSTEM_JSON_TOOL ], }));

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/angrysky56/advanced-reasoning-mcp'

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