Skip to content

feat(mcp): add create_custom_attribute and delete_custom_attribute tools - #283

Open
yakky wants to merge 5 commits into
bugfix/278-mcp-epic-link-and-version-fixesfrom
feature/us-14050-mcp-create-custom-attribute
Open

yakky wants to merge 5 commits into
bugfix/278-mcp-epic-link-and-version-fixesfrom
feature/us-14050-mcp-create-custom-attribute

Conversation

@yakky

@yakky yakky commented Oct 6, 2026

Copy link
Copy Markdown
Member

Description

Adds two MCP tools to manage custom-attribute definitions:

  • create_custom_attribute(entity_type, project, name, description="", type=None) – creates a definition for user stories, tasks, issues or epics and returns it (its id is the attribute_id for set_custom_attribute_value). type is omitted from the payload when not given. A duplicate name surfaces Taiga's real message.
  • delete_custom_attribute(entity_type, project, attribute_id, expected_name) – deletes a definition. Destructive (Taiga also drops the stored values), so it refuses, deleting nothing, unless the attribute belongs to project and is named expected_name (case and surrounding spaces ignored). Both guards are needed: attribute ids are global across projects and numbered separately per entity type, so the same id can name a different attribute on another kind.

Both use the existing *Attributes factories; no library change. Needed by the Nephila taiga-sprint-planning skill to create an "Estimation" attribute on boards that lack one.

Stacked on #279 (bugfix/278-…): this branch builds on the MCP server code there, so this PR targets that branch and shows only its own 5 commits.

References

Taiga US 14050 (https://taiga.nephila.it/project/nephila/us/14050)

Checklist

  • I have read the contribution guide
  • Code lint checked via inv lint (ruff, isort, black, pypi-description: OK)
  • changes file included (changes/14050.feature)
  • Usage documentation added in case of new features (docs/mcp.rst)
  • Tests added (unit tests for both tools + a list-tools test; 468 pass)

Verification

Live-tested on a Taiga instance, on a test board:

  • create → duplicate name rejected with Taiga's message → delete with a wrong name refused → delete with the wrong entity type refused (an issue attribute with the same id exists on another project: the project guard stopped it) → delete with the right name and a different case OK → board read back unchanged.
  • A cross-project delete was also refused before the name guard existed.

Note: the repo's pre-commit "ruff (legacy alias)" hook fails on ~99 pre-existing errors in untouched files; inv lint is clean and the new code adds none.

AI usage

Model: Claude Sonnet 5.5 (Claude Code), with Opus subagents as whole-branch reviewers.
Scope: design, tests-first implementation, docs and this PR text were drafted with AI; each commit and the push were reviewed and approved by the author. The create tool and the first version of the delete tool (fba0752) had an independent AI review; the later expected_name change (2307b6e) and the missing-owner test (cdfd016) were written in response to that review and have not had a second independent pass.
Prompts (summary): extend the MCP server so the planning skill can create a missing custom attribute; add a delete tool and live-test both on a test board; fix the review finding that an id can match a different attribute on another entity type.

Agent usage

  • Design: brainstorming + plan writing, ~60k tokens, ~20m
  • Implementation: inline plan execution incl. the delete tool and the name-guard fix, ~110k tokens, ~45m
  • Review: two Opus whole-branch reviewers, ~70k and ~65k tokens, ~1m each; code-eval and doc-sync ~15k tokens, ~5m

yakky and others added 5 commits October 6, 2026 10:51
Attribute ids are numbered per entity type, so the same id can name a
different attribute on another kind. delete_custom_attribute now takes an
expected_name and refuses, deleting nothing, when it does not match.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.25%. Comparing base (6a1f9c5) to head (2307b6e).

Additional details and impacted files
@@                              Coverage Diff                               @@
##           bugfix/278-mcp-epic-link-and-version-fixes     #283      +/-   ##
==============================================================================
+ Coverage                                       98.22%   98.25%   +0.03%     
==============================================================================
  Files                                              12       12              
  Lines                                            1576     1607      +31     
  Branches                                          151      154       +3     
==============================================================================
+ Hits                                             1548     1579      +31     
  Misses                                             19       19              
  Partials                                            9        9              
Flag Coverage Δ
unittests 98.25% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 98.818% (+0.02%) from 98.794% — feature/us-14050-mcp-create-custom-attribute into bugfix/278-mcp-epic-link-and-version-fixes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants