microfoom
API referenceVariables

foom

Variable: foom

const foom: AgentDecorators;

Defined in: packages/microfoom-core/src/decorators.ts:180

The microfoom decorator namespace. `foom.config` sets agent config on a class or method; `foom.expose` makes a method agent-callable. Both run at class-definition time and only record metadata — they never run prompts.

Example

@foom.config({ model: "openrouter/deepseek/deepseek-v4-flash" })
export default class extends Program(Input) {
  async main() {
    return await this.agent.value(z.number())`Pick a number. foom_return it.`;
  }

  @foom.expose({ announcement: "Generates a random integer in [min, max]." })
  async randomInt(min: number, max: number) {
    return Math.floor(Math.random() * (max - min + 1)) + min;
  }
}

On this page