← All procedures

procedure.export

Export a procedure definition as JSON

MCPCLI
Package
@procedures/procedure · README
Path
["procedure","export"]
CLI
mark procedure export --path <string[] | string>
MCP tool
procedure.export on the dev-tools server
As data
{"$proc":["procedure","export"],"input":{}}
Tags
procedure, registry

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/procedure"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["procedure","export"], { path: "<path>" });
console.log(JSON.stringify(result));

From the command line

$ mark procedure export --path <string[] | string>

As data, in a program

{ "$proc": ["procedure", "export"], "input": { "path": "<path>" } }

Input

FieldTypeRequiredDefaultDescription
pathstring[] | stringyesProcedure path (array or dot-separated)

Output

FieldTypeRequiredDefaultDescription
successbooleanyesTrue when the registry has the procedure
definitionobjectnoThe procedure as a procedure reference, when it exists
errorstringnoThe error message when the registry has no such procedure
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "path": {
        "anyOf": [
          {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          {
            "type": "string"
          }
        ],
        "description": "Procedure path (array or dot-separated)"
      }
    },
    "required": [
      "path"
    ]
  },
  "output": {
    "type": "object",
    "properties": {
      "success": {
        "type": "boolean",
        "description": "True when the registry has the procedure"
      },
      "definition": {
        "description": "The procedure as a procedure reference, when it exists",
        "type": "object",
        "properties": {
          "$proc": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The path of the procedure"
          },
          "metadata": {
            "description": "The metadata of the procedure",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "$proc"
        ],
        "additionalProperties": {}
      },
      "error": {
        "description": "The error message when the registry has no such procedure",
        "type": "string"
      }
    },
    "required": [
      "success"
    ],
    "additionalProperties": {}
  }
}