← All procedures

procedure.new

Scaffold a new procedure with types and registration boilerplate

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

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","new"], { name: "<name>" });
console.log(JSON.stringify(result));

From the command line

$ mark procedure new --name <string>

As data, in a program

{ "$proc": ["procedure", "new"], "input": { "name": "<name>" } }

Input

FieldTypeRequiredDefaultDescription
namestringyesProcedure name (e.g., "greet", "user.create" or "fs.readJson")
namespacestringnoNamespace override (defaults to first segment of name): the folder under src/procedures
descriptionstringnoProcedure description for CLI help
pathstringnoProject path (defaults to cwd)
dryRunbooleannofalsePreview changes without creating

Output

FieldTypeRequiredDefaultDescription
successbooleanyesTrue when the procedure was made
procedurePathstring[]yesThe path of the new procedure, for example ["user", "create"]
createdstring[]yesThe files that the call made
modifiedstring[]yesThe files that the call changed (types.ts, register.ts)
operationsstring[]yesThe steps that the call ran
errorsstring[]yesThe errors
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "pattern": "^[a-z][a-zA-Z0-9]*(\\.[a-z][a-zA-Z0-9]*)*$",
        "description": "Procedure name (e.g., \"greet\", \"user.create\" or \"fs.readJson\")"
      },
      "namespace": {
        "description": "Namespace override (defaults to first segment of name): the folder under src/procedures",
        "type": "string",
        "pattern": "^[a-z][a-zA-Z0-9]*$"
      },
      "description": {
        "description": "Procedure description for CLI help",
        "type": "string"
      },
      "path": {
        "description": "Project path (defaults to cwd)",
        "type": "string"
      },
      "dryRun": {
        "default": false,
        "description": "Preview changes without creating",
        "type": "boolean"
      }
    },
    "required": [
      "name"
    ]
  },
  "output": {
    "type": "object",
    "properties": {
      "success": {
        "type": "boolean",
        "description": "True when the procedure was made"
      },
      "procedurePath": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "The path of the new procedure, for example [\"user\", \"create\"]"
      },
      "created": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "The files that the call made"
      },
      "modified": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "The files that the call changed (types.ts, register.ts)"
      },
      "operations": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "The steps that the call ran"
      },
      "errors": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "The errors"
      }
    },
    "required": [
      "success",
      "procedurePath",
      "created",
      "modified",
      "operations",
      "errors"
    ],
    "additionalProperties": {}
  }
}