Skip to main content
Glama

create_flow

Destructive

Create a Nextcloud Flow rule that runs an operation when chosen events fire and all checks match, scoped to the current user's files or globally.

Instructions

Create a Nextcloud Flow rule: when an event happens and all checks match, run an operation.

Use get_flow_options for the operation, entity, event and check class names of the scope; an unknown class name makes Nextcloud fail with a server error. User flows act on the current user's files only. Global flows act on everyone's and need the destructive permission level: a global access control rule whose checks match too much locks every user, this server included, out of their files. Operations that would run a command, or command-line arguments, of the agent's choosing on the server are refused.

Args: operation_class: Class of the operation to run, from get_flow_options. Example: "OCA\Talk\Flow\Operation" checks: Conditions that must all match, at least one. Each is an object with "class", "operator" and "value", e.g. {"class": "OCA\WorkflowEngine\Check\FileName", "operator": "matches", "value": "/.pdf$/i"}. get_flow_options lists operators and value formats for the built-in checks. scope: "user" (default) or "global" (admin only). name: Optional name for the rule. operation_config: The operation's own settings; the format depends on the operation. Talk's "Write to conversation" takes {"m": 1, "t": ""} (m: 1 no mention, 2 mention yourself, 3 mention everyone in the room, moderators only), as an object or a JSON string. Empty for operations without settings. entity: What the rule acts on. Defaults to files ("OCA\WorkflowEngine\Entity\File"), the only entity Nextcloud ships. events: Entity events that trigger the rule, e.g. ["\OCP\Files::postCreate"]. Required unless the operation has events_fixed in get_flow_options, in which case leave it empty.

Returns: JSON with the created flow, as list_flows shows it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNo
scopeNouser
checksYes
entityNoOCA\WorkflowEngine\Entity\File
eventsNo
operation_classYes
operation_configNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.9.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and idempotentHint=false, but the description goes well beyond them: it warns that a global access-control rule with over-broad checks can lock every user (including the server) out of their files, notes the destructive permission requirement, and documents the command-execution refusal policy. This is substantive operational and safety context not available in structured fields.

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

Conciseness4/5

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

Front-loaded with purpose and safety warnings, then an Args block and a short Returns line; the ordering is logical and each section maps to a real agent need. It is long, but the length is largely justified by 0% schema coverage, with only minor repetition around get_flow_options.

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

Completeness5/5

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

An output schema exists and the description briefly notes what is returned ('JSON with the created flow, as list_flows shows it'), so it does not need to enumerate the response. Combined with full parameter documentation and destructive-behavior warnings, an agent has everything required to invoke it correctly.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must carry the whole load, and it does: every one of the seven parameters is documented with type, default behavior (scope 'user' default, entity default class, events required-unless-fixed), plus concrete examples for operation_config and the check object shape. The nested format of checks is spelled out with a realistic value.

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 opening sentence gives a precise verb+resource ('Create a Nextcloud Flow rule') plus the trigger/action model ('when an event happens and all checks match, run an operation'). It cleanly distinguishes this from the sibling read/update/delete flow tools (list_flows, update_flow, delete_flow, get_flow_options).

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

Usage Guidelines5/5

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

Explicitly routes the agent to get_flow_options for class names, states that an unknown class name causes a server error, distinguishes user vs global scope ('global (admin only)'), and names the permission level global flows require. It also states what is refused (operations that run a command or command-line arguments), so the agent knows the boundaries before calling.

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

Deploy Server

Other Tools