Skip to main content
Glama

load-local-blueprint

Upload and validate local blueprintCode with a specified processId to the Flux MCP server, enabling natural language interaction with AO for automated code handling.

Input Schema

NameRequiredDescriptionDefault
blueprintCodeYes
processIdYes

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "blueprintCode": { "type": "string" }, "processId": { "type": "string" } }, "required": [ "blueprintCode", "processId" ], "type": "object" }

Implementation Reference

  • The inline handler function for the 'load-local-blueprint' tool, which takes blueprintCode and processId, runs the Lua code in the AO process using runLuaCode, cleans the output, and returns it.
    this.server.tool( "load-local-blueprint", "load a local blueprint in an existing AO process", { blueprintCode: z.string(), processId: z.string() }, async ({ blueprintCode, processId }) => { const result = await runLuaCode(blueprintCode, processId, this.signer); return { content: [{ type: "text", text: cleanOutput(result) }], }; } );
  • Helper function runLuaCode that sends the Lua blueprint code as an 'Eval' message to the AO process and retrieves the result, used by the tool handler.
    export async function runLuaCode( code: string, processId: string, signer: any, tags?: { name: string; value: string }[] ) { const messageId = await message({ process: processId, signer, data: code, tags: [{ name: "Action", value: "Eval" }, ...(tags || [])], }); await sleep(100); const outputResult = await result({ message: messageId, process: processId, }); if (outputResult.Error) { return JSON.stringify(outputResult.Error); } return JSON.stringify(outputResult.Output.data); }
  • cleanOutput helper function used by the tool handler to format the result output.
    function cleanOutput(result: any): string { if (!result) return ""; return JSON.stringify(result, null, 2) .replace(/\\u001b\[\d+m/g, "") .replace(/\\n/g, "\n"); }
  • src/mcp.ts:205-215 (registration)
    Registration of the load-local-blueprint tool on the FluxServer MCP server, including schema and inline handler.
    this.server.tool( "load-local-blueprint", "load a local blueprint in an existing AO process", { blueprintCode: z.string(), processId: z.string() }, async ({ blueprintCode, processId }) => { const result = await runLuaCode(blueprintCode, processId, this.signer); return { content: [{ type: "text", text: cleanOutput(result) }], }; } );

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/asrvd/flux'

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