Skip to content

feat: add update-space tool#467

Open
Tom8810 wants to merge 2 commits into
kintone:mainfrom
Tom8810:feat/add-update-space-tool
Open

feat: add update-space tool#467
Tom8810 wants to merge 2 commits into
kintone:mainfrom
Tom8810:feat/add-update-space-tool

Conversation

@Tom8810

@Tom8810 Tom8810 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Why

The kintone MCP had no way to update space settings via the Space REST API (PUT /k/v1/space.json). This made it impossible to adjust space configuration—such as name, privacy, member lock, multi-thread mode, portal widget visibility, and who may create apps (EVERYONE vs ADMIN)—through the MCP server, even when an administrator wanted to do so programmatically.

Because this is a privileged write operation that requires space administrator privileges and cannot work with API tokens, this tool is disabled when using API token authentication (consistent with kintone-get-apps, kintone-add-app, and kintone-search).

What

  • Add kintone-update-space: takes a space id plus optional fields (name, isPrivate, fixedMember, useMultiThread, showAnnouncement, showThreadList, showAppList, showMemberList, showRelatedLinkList, permissions). Calls KintoneRestAPIClient.space.updateSpace and returns an empty result, matching the API's empty success response.
    • Only fields included in the request are updated; omitted fields keep their existing values.
    • useMultiThread is applied only when true (single-thread → multi-thread switch); passing false has no effect, per the kintone REST API.
    • name is limited to 100 characters via Zod.
  • Add spaceSchema / permissionsSchema (Zod) under src/schema/space/ so field shapes and descriptions are explicit and reusable.
  • Add unit tests for tool name, description, input/output schemas, and the mocked callback path.
  • Update manifest.json, README.md, and README_en.md, and extend tool-filters so the tool is excluded under API token auth.
  • Extend test createMockClient with a space.updateSpace mock hook.

How to test

  1. Configure a kintone environment where you have space administrator privileges on the target space, with KINTONE_BASE_URL and credentials that the Space API accepts (not API-token-only if you expect this tool to be available).
  2. With API token only, confirm kintone-update-space is not enabled (or does not appear in the tool list), matching other excluded tools.
  3. With username/password (or other supported user auth), call kintone-update-space with a valid space id and one or more fields to change (e.g. name, isPrivate, permissions.createApp).
  4. Verify the update succeeds (empty body on success) and that only the supplied fields changed while omitted fields kept their previous values.
  5. Confirm useMultiThread: true switches a single-thread space to multi-thread, and that passing false leaves the setting unchanged.
  6. Optionally cross-check the resulting settings against the space in the kintone administration UI.

Checklist

  • Updated documentation if it is required.
  • Added tests if it is required.
  • Passed pnpm lint and pnpm test on the root directory.

@Tom8810 Tom8810 requested a review from a team as a code owner June 4, 2026 07:43
@Tom8810 Tom8810 requested review from chihiro-adachi and nameless-mc and removed request for a team June 4, 2026 07:43
@shabaraba shabaraba self-assigned this Jun 25, 2026
shabaraba
shabaraba previously approved these changes Jun 25, 2026
),
name: z
.string()
.max(100)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nameのバリデーションは1文字以上128文字以下でお願いします 🙇

@shabaraba shabaraba dismissed their stale review June 25, 2026 12:24

Sorry, I missed pointing this out earlier

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants