← 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
| Field | Type | Required | Default | Description |
|---|
name | string | yes | | Procedure name (e.g., "greet", "user.create" or "fs.readJson") |
namespace | string | no | | Namespace override (defaults to first segment of name): the folder under src/procedures |
description | string | no | | Procedure description for CLI help |
path | string | no | | Project path (defaults to cwd) |
dryRun | boolean | no | false | Preview changes without creating |
Output
| Field | Type | Required | Default | Description |
|---|
success | boolean | yes | | True when the procedure was made |
procedurePath | string[] | yes | | The path of the new procedure, for example ["user", "create"] |
created | string[] | yes | | The files that the call made |
modified | string[] | yes | | The files that the call changed (types.ts, register.ts) |
operations | string[] | yes | | The steps that the call ran |
errors | string[] | yes | | The 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": {}
}
}