Skip to main content
Glama

Cooper Email

Create inbox rule

cooper_create_rule
Idempotent

Use this when mail like X should be labeled, filed, forwarded, or acknowledged on the server with no model call, including mail to one plus address. Requires auth and message_update. Creating a rule with forward_to or auto_reply also needs message_send. HTTP 403 permission_denied with param actions when it does not, and nothing is stored. Inputs: inbox_id (required), name (required, 1–80 characters), conditions (required object; at least one of from, to, subject_contains, body_contains, has_attachment, auth, list, alias), actions (required object; at least one of add_labels, folder, mark_read true, forward_to, auto_reply, or stop_processing), enabled (optional boolean, default true), position (optional integer; lower runs first), stop_processing (optional boolean), client_id (optional idempotency key, at most 128 characters). from is an email, @domain, or a domain. alias is the plus tag. auth is pass or fail and uses DMARC. forward_to is another inbox on this account or a verified owner of this inbox. auto_reply.text is at most 2,000 characters. auto_reply.cooldown_hours is 1–720 and defaults to 24. An inbox stores at most 20 rules (HTTP 409 rule_limit). A bad rule is HTTP 400 invalid_rule. A disallowed forward_to is HTTP 400 forward_target_not_allowed. The same client_id returns the original rule and does not create a second one. Returns the inbox_rule.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "inbox_id": "<inbox_id>",
      "name": "<name>",
      "conditions": "<conditions>",
      "actions": "<actions>"
    },
    "name": "cooper_create_rule"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesRule name, 1 to 80 characters.
actionsYesadd_labels, folder (inbox|archive|spam|trash), mark_read, forward_to, auto_reply {text, subject?, cooldown_hours?}.
enabledNoWhen false the rule is stored and does not run. Default true.
inbox_idYesInbox id (inb_…), username, or full email address owned by this key
positionNoSort key. Lower numbers run first. Ties break by created_at. Omit to append.
client_idNoOptional idempotency key, 1 to 128 characters. The same key returns the original rule.
conditionsYesAll set conditions must match. from, to, subject_contains, body_contains (max 256), has_attachment, auth pass|fail, list, alias (exact plus tag).
stop_processingNoWhen true, later rules do not run after this one matches.

Output Schema

NameRequiredDescriptionDefault
idNoRule id. Pass it as rule_id.
nameNoHuman-readable name.
objectNoObject type name, such as list, message, or thread.
actionsNoWhat happens to a matching message.
enabledNoTrue when the object is active.
inbox_idNoInbox id (inb_…) this object belongs to. Null when it applies to every inbox.
positionNoOrder the rule runs in. Lower runs first.
client_idNoCaller idempotency key stored with the object, or null.
conditionsNoWhat a message must match.
created_atNoISO-8601 time the object was created.
last_errorNoLast action error, or null.
updated_atNoISO-8601 time the object last changed.
match_countNoHow many messages matched.
last_matched_atNoISO-8601 time of the last match, or null.
stop_processingNoWhen true, later rules are skipped after a match.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / conditions / description
      Previous value: -"All set conditions must match. from, to, subject_contains, body_contains (max 256), has_attachment, auth pass|fail, list."New value: +"All set conditions must match. from, to, subject_contains, body_contains (max 256), has_attachment, auth pass|fail, list, alias (exact plus tag)."
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "description": "The new inbox rule.",
      +  "properties": {
      +    "actions": {
      +      "description": "What happens to a matching message."
      +    },
      +    "client_id": {
      +      "description": "Caller idempotency key stored with the object, or null."
      +    },
      +    "conditions": {
      +      "description": "What a message must match."
      +    },
      +    "created_at": {
      +      "description": "ISO-8601 time the object was created."
      +    },
      +    "enabled": {
      +      "description": "True when the object is active."
      +    },
      +    "id": {
      +      "description": "Rule id. Pass it as rule_id."
      +    },
      +    "inbox_id": {
      +      "description": "Inbox id (inb_…) this object belongs to. Null when it applies to every inbox."
      +    },
      +    "last_error": {
      +      "description": "Last action error, or null."
      +    },
      +    "last_matched_at": {
      +      "description": "ISO-8601 time of the last match, or null."
      +    },
      +    "match_count": {
      +      "description": "How many messages matched."
      +    },
      +    "name": {
      +      "description": "Human-readable name."
      +    },
      +    "object": {
      +      "description": "Object type name, such as list, message, or thread."
      +    },
      +    "position": {
      +      "description": "Order the rule runs in. Lower runs first."
      +    },
      +    "stop_processing": {
      +      "description": "When true, later rules are skipped after a match."
      +    },
      +    "updated_at": {
      +      "description": "ISO-8601 time the object last changed."
      +    }
      +  },
      +  "type": "object"
      +}
  3. Added

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only declare it is a non-destructive, idempotent, non-open-world write; the description goes far beyond that with the exact failure modes (403 permission_denied on actions, 409 rule_limit at 20 rules, 400 invalid_rule, 400 forward_target_not_allowed), the guarantee that nothing is stored on failure, and the client_id replay semantics. This is exactly the context an agent needs before attempting a mutation.

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?

The single paragraph is front-loaded with the trigger condition and permissions before error codes and parameter detail, and almost every clause carries information. It is dense enough that the error codes and the parameter list blur together without line breaks or grouping, which costs it the top score.

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?

For an 8-parameter mutation with nested conditions/actions objects, the description covers permissions, per-parameter semantics, limits, idempotency, and all documented error paths. Return values are handled by the existing output schema and the brief 'Returns the inbox_rule' note is sufficient.

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 coverage is already 100%, yet the description still adds semantics the schema lacks: from accepts an email, @domain, or bare domain; alias is the plus tag; auth is pass/fail evaluated via DMARC; forward_to must be another inbox on the account or a verified owner; auto_reply.text caps at 2,000 characters and cooldown_hours ranges 1–720 with a 24 default. It also restates the required minimum-one-condition and minimum-one-action constraints, which materially shape a valid call.

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

Purpose4/5

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

The opening sentence names the resource and effect precisely: server-side labeling, filing, forwarding, or acknowledging of matching mail with no model call, plus plus-addressing support. It is clearly the rule-creation tool, distinguishable from list_rules/update_rule/delete_rule by implication. It never states the verb 'create' outright or names the sibling test_rule, so it falls just short of a 5.

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?

It gives an explicit trigger condition ('when mail like X should be labeled, filed, forwarded, or acknowledged on the server with no model call') and the prerequisite scopes (auth, message_update, plus message_send for forward_to/auto_reply). What is missing is routing guidance against the obvious alternatives cooper_test_rule and cooper_update_rule, which are the natural tools for validating or editing an existing rule.

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.