Home/Tools/@tpmjs/tools-recipe-emit

recipeEmitTool

@tpmjs/tools-recipe-emit

Emits a recipe in standard format for workflow orchestration. Takes a recipe name, array of steps (each with tool, inputs, and outputs), and optional metadata. Returns a validated, formatted recipe ready for execution.

Official
agent
v0.2.0
MIT

Interactive Playground

Test @tpmjs/tools-recipe-emit (recipeEmitTool) with AI-powered execution

0/2000 characters

Installation & Usage

Install this tool and use it with the AI SDK

1. Install the package

npm install @tpmjs/tools-recipe-emit
pnpm add @tpmjs/tools-recipe-emit
yarn add @tpmjs/tools-recipe-emit
bun add @tpmjs/tools-recipe-emit
deno add npm:@tpmjs/tools-recipe-emit

2. Import the tool

import { recipeEmitTool } from '@tpmjs/tools-recipe-emit';

3. Use with AI SDK

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { recipeEmitTool } from '@tpmjs/tools-recipe-emit';

const result = await generateText({
  model: openai('gpt-4o'),
  tools: { recipeEmitTool },
  prompt: 'Your prompt here...',
});

console.log(result.text);

Parameters

Available configuration options

Auto-extracted
name
Required
Type: string

The name of the recipe

steps
Required
Type: array

Array of workflow steps

metadata
Optional
Type: object

Optional metadata about the recipe

Schema extracted: 1/1/2026, 8:18:24 AM

README

@tpmjs/tools-recipe-emit

Emits a recipe in standard format for workflow orchestration. Validates and formats workflow recipes with steps, inputs, and outputs.

Installation

npm install @tpmjs/tools-recipe-emit

Usage

import { recipeEmitTool } from '@tpmjs/tools-recipe-emit';

const result = await recipeEmitTool.execute({
  name: 'Data Processing Pipeline',
  steps: [
    {
      tool: 'fetchData',
      inputs: { url: 'https://api.example.com/data' },
      outputs: { rawData: 'string' },
      description: 'Fetch data from API',
    },
    {
      tool: 'transformData',
      inputs: { rawData: 'string' },
      outputs: { processedData: 'object' },
      description: 'Transform raw data',
    },
    {
      tool: 'saveData',
      inputs: { processedData: 'object' },
      outputs: { success: 'boolean' },
      description: 'Save processed data',
    },
  ],
  metadata: {
    author: 'John Doe',
    version: '1.0.0',
    description: 'A simple data processing pipeline',
    tags: ['data', 'pipeline', 'etl'],
  },
});

console.log(result);
// {
//   recipe: {
//     name: 'Data Processing Pipeline',
//     version: '1.0.0',
//     steps: [...],
//     metadata: {...}
//   },
//   format: 'tpmjs-recipe-v1',
//   stepCount: 3,
//   validation: {
//     isValid: true,
//     warnings: []
//   }
// }

Features

  • Validation: Validates recipe structure and warns about potential issues
  • Step Chaining: Detects missing connections between step outputs and inputs
  • Standard Format: Outputs recipes in the TPMJS standard format (tpmjs-recipe-v1)
  • Metadata Support: Includes author, version, tags, and custom metadata
  • Detailed Warnings: Provides actionable warnings for recipe improvement

Input Schema

{
  name: string;              // Recipe name
  steps: Array<{             // Workflow steps
    tool: string;            // Tool name to execute
    inputs: object;          // Input parameters
    outputs: object;         // Expected outputs
    description?: string;    // Optional step description
  }>;
  metadata?: {               // Optional metadata
    author?: string;
    version?: string;
    description?: string;
    tags?: string[];
    createdAt?: string;
  };
}

Output Schema

{
  recipe: {
    name: string;
    version: string;
    steps: RecipeStep[];
    metadata: RecipeMetadata;
  };
  format: string;            // Always 'tpmjs-recipe-v1'
  stepCount: number;         // Number of steps
  validation: {
    isValid: boolean;        // Whether recipe is valid
    warnings: string[];      // Validation warnings
  };
}

License

MIT

Statistics

Downloads/month

0

Quality Score

0%

Bundle Size

NPM Keywords

tpmjs
agent
workflow
recipe

Maintainers

thomasdavis(thomasalwyndavis@gmail.com)

Frameworks

vercel-ai