Skip to main content
Glama

Create Function

onto_function_create

RECHENREGEL anlegen: eine Function. Anders als ein Trigger hat sie EINGABEN und einen AUSDRUCK — sie rechnet, statt nur zu reagieren. "inputs": Liste von {key, type, required}; Typen: object, string, int, float, bool, datetime, list. "body": der Ausdruck. body-Format: {"inputs":[{"key":"kmStand","type":"int","required":true}],"body":{"if":[{">":[{"field":["kmStand"]},{"field":["letzterService"]}]},"faellig","ok"]},"effects":[]}. Der Ausdruck AST hat IMMER die Form {"operator":[argumente]} — also {"-":[a,b]} fuer a minus b, nicht {"op":...}. Operatoren u.a.: field/var, source, link, linklist, and/or/!/if, ==/!=/</<=/>/>=/in/notin/empty/notempty/matches, +/-/*///%/min/max/abs/round, cat/lower/upper/len/trim, count_of/sum_of/max_of/min_of. Kein eval — nur diese Operatoren. Das Ergebnis steht als {result} bereit und wird in Regeln per run_function genutzt. Optional "effects" (set_property/create_object/create_link). RECHTE: scope_id muss ein Scope sein, den du VERWALTEST (can_manage_scope=1). | EN: function, automation, expression, script, effect ZEITREGEL: Datum/Zeit liegt in der DB als UTC und wird von MCP ROH als UTC ausgegeben — im Browser eingegebene 10:00 erscheinen hier als 09:00 (Winter) / 08:00 (Sommer); die Oberflaeche rechnet in die Betrachterzone um (Cookie -> Profilfeld -> Europe/Berlin). Zeit-Operatoren: minutes_of, minutes_between[von,bis], hours_between[von,bis,pause_minuten].

Input Schema

NameRequiredDescriptionDefault
keyNoTechnischer Schluessel (a-zA-Z0-9_). Ohne Angabe = name.
bodyYesDie Definition als Objekt oder JSON-String. body-Format: {"inputs":[{"key":"kmStand","type":"int","required":true}],"body":{"if":[{">":[{"field":["kmStand"]},{"field":["letzterService"]}]},"faellig","ok"]},"effects":[]}. Der Ausdruck AST hat IMMER die Form {"operator":[argumente]} — also {"-":[a,b]} fuer a minus b, nicht {"op":...}. Operatoren u.a.: field/var, source, link, linklist, and/or/!/if, ==/!=/</<=/>/>=/in/notin/empty/notempty/matches, +/-/*///%/min/max/abs/round, cat/lower/upper/len/trim, count_of/sum_of/max_of/min_of. Zeit: minutes_of, minutes_between, hours_between (siehe ZEITREGEL unten). Ist inputs.objekt (32-hex) gesetzt, liest der Ausdruck die FELDER dieses Objekts direkt ({"field":["shiftStart"]}), ohne dass sie als inputs deklariert sein muessen; deklarierte inputs haben Vorrang. Kein eval — nur diese Operatoren. Das Ergebnis steht als {result} bereit und wird in Regeln per run_function genutzt.
nameYesAnzeigename (z.B. 'Wartung faellig?')
labelNoAnzeigetext
scope_idYesZiel-Scope. Du musst dort Manager sein (can_manage_scope).
descriptionNoBeschreibung (optional)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / body / description
      Previous value: -"Die Definition als Objekt oder JSON-String. body-Format: {\"inputs\":[{\"key\":\"kmStand\",\"type\":\"int\",\"required\":true}],\"body\":{\"if\":[{\">\":[{\"field\":[\"kmStand\"]},{\"field\":[\"letzterService\"]}]},\"faellig\",\"ok\"]},\"effects\":[]}. Der Ausdruck AST hat IMMER die Form {\"operator\":[argumente]} — also {\"-\":[a,b]} fuer a minus b, nicht {\"op\":...}. Operatoren u.a.: field/var, source, link, linklist, and/or/!/if, ==/!=/</<=/>/>=/in/notin/empty/notempty/matches, +/-/*///%/min/max/abs/round, cat/lower/upper/len/trim, count_of/sum_of/max_of/min_of. Kein eval — nur diese Operatoren. Das Ergebnis steht als {result} bereit und wird in Regeln per run_function genutzt."New value: +"Die Definition als Objekt oder JSON-String. body-Format: {\"inputs\":[{\"key\":\"kmStand\",\"type\":\"int\",\"required\":true}],\"body\":{\"if\":[{\">\":[{\"field\":[\"kmStand\"]},{\"field\":[\"letzterService\"]}]},\"faellig\",\"ok\"]},\"effects\":[]}. Der Ausdruck AST hat IMMER die Form {\"operator\":[argumente]} — also {\"-\":[a,b]} fuer a minus b, nicht {\"op\":...}. Operatoren u.a.: field/var, source, link, linklist, and/or/!/if, ==/!=/</<=/>/>=/in/notin/empty/notempty/matches, +/-/*///%/min/max/abs/round, cat/lower/upper/len/trim, count_of/sum_of/max_of/min_of. Zeit: minutes_of, minutes_between, hours_between (siehe ZEITREGEL unten). Ist inputs.objekt (32-hex) gesetzt, liest der Ausdruck die FELDER dieses Objekts direkt ({\"field\":[\"shiftStart\"]}), ohne dass sie als inputs deklariert sein muessen; deklarierte inputs haben Vorrang. Kein eval — nur diese Operatoren. Das Ergebnis steht als {result} bereit und wird in Regeln per run_function genutzt."
  2. Added
  3. Removed
  4. First observed

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already establish that this is a non-read-only, non-destructive, non-idempotent write operation. The description adds valuable behavioral context beyond annotations: the caller must manage the target scope, only a fixed operator set is allowed with no eval, optional effects can be attached, and the computed result is exposed as {result} for use in rules. It does not describe duplicate-key behavior or the exact creation response, so this is strong but not complete.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose, but it is long and repeats the body format and operator list that the schema already provides. The appended ZEITREGEL block is relevant to function authoring but adds considerable length, so the text is useful yet not fully concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex nested create tool with no output schema, the description covers the DSL, operator constraints, permissions, optional effects, and result usage well. It does not explain what the create call itself returns, such as the new function identifier, or how duplicate names/keys are handled, leaving a modest completeness gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the parameters in detail, including the body AST format, operator examples, and scope permission requirement. The description adds some meaning, such as the input type list and optional effects, but much of the body semantics duplicates the schema. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'RECHENREGEL anlegen: eine Function.' It also distinguishes the tool from a trigger by explaining that a function has inputs and an expression and computes rather than reacts, which lets an agent identify the tool without inspecting its schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context: this is for creating a function, unlike a trigger, and the result is later used in rules via run_function. It also states the permission prerequisite for scope_id. It does not explicitly enumerate when to choose this over sibling tools such as onto_trigger_create or onto_function_update, but the main usage context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.