Skip to content

Conversation

@maxheadroom
Copy link

Description

This PR extends the existing get_page tool with the capability to fetch a Confluence Page previous version. If no version is specified, then the latest version is fetched (current behaviour). Optionally a previous version can be specified and then that version of the page is returned.

This enables LLM use cases like: Compare the latest version of page 12355 with it's version 5 and summarise the changes.

Changes

  • added version parameter to get_page tool
  • updated documentation and tests

Testing

  • Unit tests added/updated
  • Integration tests passed
  • Manual checks performed: added MCP to my local LLM and asked it to provide various versions of a page. Verified that the MCP really provided previous versions and not just halucinated the content.

Checklist

  • Code follows project style guidelines (linting passes).
  • Tests added/updated for changes.
  • All tests pass locally.
  • Documentation updated (if needed).

Falko Zurell and others added 18 commits September 18, 2025 16:13
- Add optional version parameter to get_page_content method in pages.py
- Update v2_adapter.get_page to support version parameter
- Extend confluence server get_page tool with version parameter
- Maintains backward compatibility with existing usage
- Version parameter only works with page_id, not title/space_key lookup
- Fix line length issues in pages.py and other files
- Add proper error handling for version parameter with title/space_key lookup
- Maintain backward compatibility for existing API calls
- Add tests for get_page_content with version parameter for both v1 and v2 APIs
- Add server-level tests for version parameter in confluence_get_page tool
- Add test for error handling when version is used with title/space_key lookup
- All tests pass with proper mocking and validation
- Update README.md to mention version support in confluence_get_page tool
- Update CLAUDE.md to include version history in Confluence capabilities
- Add clear indication of version support in tool descriptions and tables
allow manual trigger of the lint workflow
- Extended ConfluenceVersion model with minor_edit field
- Added get_page_versions and get_page_version methods to PagesMixin
- Added v2 API support in ConfluenceV2Adapter
- Added confluence_get_page_versions MCP tool
- Added comprehensive tests for new functionality
- Fixed test_get_page_content_oauth_uses_v2_api to match new v2_adapter signature
- Added confluence_get_page_versions to README documentation
- Updated tools comparison table
- Updated test expectations to include version=None parameter
- All confluence server tests now pass
✅ FEATURE COMPLETE: Added confluence_get_page_versions tool

Implementation includes:
- Extended ConfluenceVersion model with minor_edit field
- Added get_page_versions/get_page_version methods to PagesMixin
- Extended ConfluenceV2Adapter with v2 API support
- Added confluence_get_page_versions MCP tool
- Comprehensive test coverage (all tests passing)
- Updated documentation and README
- Supports both Cloud (v2 API) and Server/DC (v1 API)
- Proper error handling and authentication
- Follows MCP specifications and existing code patterns

The tool can list all versions or get specific version details for any Confluence page.
- Follows existing naming convention where tool names don't include service prefix
- Updated function name, tests, and documentation
- Tool is now properly named 'get_page_versions' instead of 'confluence_confluence_get_page_versions'
- All tests still pass
- Use proper /rest/api/content/{id}/version endpoint for v1 API
- Add fallback to current version only if versions endpoint fails
- Now correctly returns multiple versions for pages with version history
- All tests still pass
- Add /wiki prefix for Cloud instances in v1 API calls
- Now correctly returns multiple versions (tested with real data)
- Test shows 2 versions returned instead of just 1
- Add test script for real-world validation
- Add missing return type annotations
- Fix TYPE_CHECKING import for ConfluenceVersion
- Apply code formatting
- All pre-commit checks now pass
- Replace /history endpoint (only returns 2 versions) with /version endpoint
- Add pagination support to get all versions (50 per page)
- Now correctly returns all 16 versions for test page 1137248511
- Verified with real test data showing complete version history
- Fix trailing whitespace and end-of-file formatting
- Apply ruff code formatting
- All pre-commit checks now pass
@maxheadroom
Copy link
Author

Added an explicit "get_page_versions" tool to fetch page history information. This has been tested with Atlassian Cloud.

Falko Zurell added 5 commits September 19, 2025 13:31
- get_page now only returns current version (no version parameter)
- get_page_version is the dedicated tool for retrieving specific versions
- This eliminates confusion for LLMs about which tool to use
- Updated tests to remove version-related test cases
- All tests pass and linting is clean

Resolves tool overlap where both get_page and get_page_version could
return previous versions, making it unclear which tool to use.
- get_page_versions: Only returns list of available versions (no content)
- get_page: Returns page content, with optional version parameter for specific versions
- Eliminates ambiguous output that confused LLMs
- Clear separation: list versions vs get content
- Updated tests to reflect new behavior
- All tests pass and linting is clean

This resolves the confusion where get_page_versions could return either
a list of versions OR page content depending on parameters.
- Added new get_page_version tool that fetches a specific version of a Confluence page
- Removed version parameter from get_page tool to separate concerns
- Updated server tests to include new tool and remove version-related functionality
- Updated unit tests to reflect the changes in get_page_content method calls
- Tool follows Atlassian API documentation for fetching page versions
- Renamed get_page_versions to list_page_versions for better clarity
- Updated all test files and imports to use the new name
- Updated function documentation to reflect the rename
- Tool is now accessible as confluence_list_page_versions in MCP server
@github-actions
Copy link

github-actions bot commented Oct 7, 2025

This pull request has been automatically marked as stale because it has not had recent activity for 14 days. It will be closed if no further activity occurs. Please leave a comment or remove the 'stale' label if you believe this PR is still relevant. Thank you for your contributions!

@github-actions github-actions bot added the stale label Oct 7, 2025
nszceta added a commit to nszceta/mcp-atlassian that referenced this pull request Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant