Skip to content

zammad_add_article fails for emails due to API contradictions #205

@Erudition

Description

@Erudition

The zammad_add_article tool cannot be used to send outgoing emails. Although the tool's docstring in server.py claims to support email-specific parameters like to, cc, and subject, these fields are missing from the underlying Pydantic model and client implementation.

This creates a "catch-22" situation:

  1. If an agent includes the to parameter (as suggested by the docstring), the MCP server's Pydantic validation fails with an extra_forbidden error.
  2. If an agent omits the to parameter and sets article_type: "email", the Zammad API returns an error stating that "Sending an email without a valid recipient is not possible."

Reproduction Steps

Attempt to add an email article to an existing ticket using the following parameters:

{
  "params": {
    "ticket_id": 12345,
    "body": "Your response here",
    "article_type": "email",
    "to": "customer@example.com"
  }
}

Actual Behavior

The following Pydantic validation error is returned:

Error executing tool zammad_add_article: 1 validation error for zammad_add_articleArguments
params.to
  Extra inputs are not permitted [type=extra_forbidden, input_value='customer@example.com', input_type=str]

If the to field is removed:

Error executing tool zammad_add_article: {"error":"...","invalid_attribute":{"email_recipient":"Sending an email without a valid recipient is not possible."}}

Expected Behavior

The tool should allow passing to, cc, subject, and content_type as optional parameters when the article_type is set to email.

Technical Details

The following components need to be updated:

  1. mcp_zammad/models.py: Add to, cc, subject, and content_type fields to the ArticleCreate Pydantic model.
  2. mcp_zammad/client.py: Update the add_article method to accept these new parameters and include them in the article_data payload sent to the Zammad API.
  3. mcp_zammad/server.py: Ensure the zammad_add_article tool handler extracts these fields from the ArticleCreate model and passes them to the client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions