Skip to content

Comments

feat: add pagination and schema introspection to GetTableContents#37

Open
kts982 wants to merge 1 commit intooisee:mainfrom
kts982:feat/table-pagination-schema
Open

feat: add pagination and schema introspection to GetTableContents#37
kts982 wants to merge 1 commit intooisee:mainfrom
kts982:feat/table-pagination-schema

Conversation

@kts982
Copy link
Contributor

@kts982 kts982 commented Feb 23, 2026

Summary

Adds two new parameters to GetTableContents:

  • offset: skip first N rows for pagination (e.g., offset=100, max_rows=100 for page 2)
  • columns_only: return only column metadata (name, type, description, length, key) without data rows — for schema introspection

Changes

  • pkg/adt/client.go — new GetTableContentsWithOptions method with GetTableContentsOptions struct; existing GetTableContents delegates to it (backward compatible)
  • internal/mcp/handlers_read.go — parse offset and columns_only parameters
  • internal/mcp/server.go — register new parameters on GetTableContents tool

Test plan

  • go build ./pkg/adt/ — compiles cleanly
  • Pre-existing unit tests pass
  • Live system test passed against a SAP system:
    • columns_only=true on T000: returned 17 columns with full metadata, no data rows
    • offset=0, max_rows=2: returned first 2 rows (clients 000, 001)
    • offset=2, max_rows=2: returned next 2 rows (clients 070, 100) — different data, pagination works

Refs #34

Adds two new parameters to GetTableContents:
- offset: skip first N rows for pagination (e.g., offset=100, max_rows=100
  for page 2)
- columns_only: return only column metadata (name, type, description,
  length, key) without data rows, for schema introspection

Internally adds GetTableContentsWithOptions for the extended API while
preserving backward compatibility through the existing GetTableContents
signature.

Refs oisee#34
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.

1 participant