mcp-quickbase 2.0.5 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.crewchief/runs/state.json +3 -0
- package/.mcp.json +6 -32
- package/.sdd/tickets/RELS_relationship-management/README.md +98 -0
- package/.sdd/tickets/RELS_relationship-management/planning/analysis.md +190 -0
- package/.sdd/tickets/RELS_relationship-management/planning/architecture.md +413 -0
- package/.sdd/tickets/RELS_relationship-management/planning/plan.md +177 -0
- package/.sdd/tickets/RELS_relationship-management/planning/quality-strategy.md +335 -0
- package/.sdd/tickets/RELS_relationship-management/planning/review-updates.md +95 -0
- package/.sdd/tickets/RELS_relationship-management/planning/security-review.md +213 -0
- package/.sdd/tickets/RELS_relationship-management/planning/ticket-review.md +885 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.1001_domain-setup.md +96 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.1002_get-relationships-tool.md +142 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.1003_register-phase1-tools.md +105 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.2001_create-relationship-tool.md +151 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.2002_update-relationship-tool.md +145 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.3001_delete-relationship-tool.md +154 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.4001_integration-testing.md +159 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS.4002_final-verification.md +182 -0
- package/.sdd/tickets/RELS_relationship-management/tasks/RELS_TASK_INDEX.md +179 -0
- package/crewchief.config.js +31 -0
- package/dist/client/quickbase.d.ts +7 -2
- package/dist/client/quickbase.js +64 -51
- package/dist/client/quickbase.js.map +1 -1
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/server.d.ts +3 -3
- package/dist/mcp/server.js +21 -17
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp-stdio-server.js +64 -49
- package/dist/mcp-stdio-server.js.map +1 -1
- package/dist/server.js +84 -83
- package/dist/server.js.map +1 -1
- package/dist/tools/apps/create_app.d.ts +2 -2
- package/dist/tools/apps/create_app.js +23 -23
- package/dist/tools/apps/create_app.js.map +1 -1
- package/dist/tools/apps/index.d.ts +4 -4
- package/dist/tools/apps/index.js +3 -3
- package/dist/tools/apps/list_tables.d.ts +7 -7
- package/dist/tools/apps/list_tables.js +28 -27
- package/dist/tools/apps/list_tables.js.map +1 -1
- package/dist/tools/apps/update_app.d.ts +2 -2
- package/dist/tools/apps/update_app.js +28 -26
- package/dist/tools/apps/update_app.js.map +1 -1
- package/dist/tools/base.d.ts +3 -3
- package/dist/tools/base.js +7 -7
- package/dist/tools/base.js.map +1 -1
- package/dist/tools/configure_cache.d.ts +3 -3
- package/dist/tools/configure_cache.js +16 -16
- package/dist/tools/configure_cache.js.map +1 -1
- package/dist/tools/fields/create_field.d.ts +8 -7
- package/dist/tools/fields/create_field.js +39 -29
- package/dist/tools/fields/create_field.js.map +1 -1
- package/dist/tools/fields/delete_field.d.ts +79 -0
- package/dist/tools/fields/delete_field.js +105 -0
- package/dist/tools/fields/delete_field.js.map +1 -0
- package/dist/tools/fields/get_field.d.ts +91 -0
- package/dist/tools/fields/get_field.js +82 -0
- package/dist/tools/fields/get_field.js.map +1 -0
- package/dist/tools/fields/index.d.ts +5 -3
- package/dist/tools/fields/index.js +11 -5
- package/dist/tools/fields/index.js.map +1 -1
- package/dist/tools/fields/update_field.d.ts +7 -15
- package/dist/tools/fields/update_field.js +39 -38
- package/dist/tools/fields/update_field.js.map +1 -1
- package/dist/tools/files/download_file.d.ts +2 -2
- package/dist/tools/files/download_file.js +35 -35
- package/dist/tools/files/download_file.js.map +1 -1
- package/dist/tools/files/index.d.ts +3 -3
- package/dist/tools/files/index.js +3 -3
- package/dist/tools/files/upload_file.d.ts +2 -2
- package/dist/tools/files/upload_file.js +52 -44
- package/dist/tools/files/upload_file.js.map +1 -1
- package/dist/tools/index.d.ts +13 -12
- package/dist/tools/index.js +6 -3
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/records/bulk_create_records.d.ts +2 -2
- package/dist/tools/records/bulk_create_records.js +28 -28
- package/dist/tools/records/bulk_create_records.js.map +1 -1
- package/dist/tools/records/bulk_update_records.d.ts +2 -2
- package/dist/tools/records/bulk_update_records.js +27 -27
- package/dist/tools/records/bulk_update_records.js.map +1 -1
- package/dist/tools/records/create_record.d.ts +2 -2
- package/dist/tools/records/create_record.js +40 -40
- package/dist/tools/records/create_record.js.map +1 -1
- package/dist/tools/records/index.d.ts +6 -6
- package/dist/tools/records/index.js +3 -3
- package/dist/tools/records/query_records.d.ts +3 -3
- package/dist/tools/records/query_records.js +82 -78
- package/dist/tools/records/query_records.js.map +1 -1
- package/dist/tools/records/update_record.d.ts +2 -2
- package/dist/tools/records/update_record.js +31 -29
- package/dist/tools/records/update_record.js.map +1 -1
- package/dist/tools/registry.d.ts +1 -1
- package/dist/tools/registry.js +1 -1
- package/dist/tools/relationships/create_relationship.d.ts +150 -0
- package/dist/tools/relationships/create_relationship.js +181 -0
- package/dist/tools/relationships/create_relationship.js.map +1 -0
- package/dist/tools/relationships/delete_relationship.d.ts +66 -0
- package/dist/tools/relationships/delete_relationship.js +85 -0
- package/dist/tools/relationships/delete_relationship.js.map +1 -0
- package/dist/tools/relationships/get_relationships.d.ts +126 -0
- package/dist/tools/relationships/get_relationships.js +126 -0
- package/dist/tools/relationships/get_relationships.js.map +1 -0
- package/dist/tools/relationships/index.d.ts +14 -0
- package/dist/tools/relationships/index.js +37 -0
- package/dist/tools/relationships/index.js.map +1 -0
- package/dist/tools/relationships/update_relationship.d.ts +139 -0
- package/dist/tools/relationships/update_relationship.js +168 -0
- package/dist/tools/relationships/update_relationship.js.map +1 -0
- package/dist/tools/reports/index.d.ts +2 -2
- package/dist/tools/reports/index.js +3 -3
- package/dist/tools/reports/run_report.d.ts +3 -3
- package/dist/tools/reports/run_report.js +29 -29
- package/dist/tools/reports/run_report.js.map +1 -1
- package/dist/tools/tables/create_table.d.ts +2 -49
- package/dist/tools/tables/create_table.js +26 -49
- package/dist/tools/tables/create_table.js.map +1 -1
- package/dist/tools/tables/get_table_fields.d.ts +2 -2
- package/dist/tools/tables/get_table_fields.js +25 -25
- package/dist/tools/tables/get_table_fields.js.map +1 -1
- package/dist/tools/tables/index.d.ts +4 -4
- package/dist/tools/tables/index.js +3 -3
- package/dist/tools/tables/update_table.d.ts +2 -2
- package/dist/tools/tables/update_table.js +28 -26
- package/dist/tools/tables/update_table.js.map +1 -1
- package/dist/tools/test_connection.d.ts +2 -2
- package/dist/tools/test_connection.js +28 -28
- package/dist/tools/test_connection.js.map +1 -1
- package/dist/types/api.d.ts +1 -1
- package/dist/types/mcp.d.ts +1 -1
- package/dist/utils/cache.js +16 -16
- package/dist/utils/cache.js.map +1 -1
- package/dist/utils/file.js +44 -40
- package/dist/utils/file.js.map +1 -1
- package/dist/utils/logger.js +30 -28
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/retry.js +10 -10
- package/dist/utils/retry.js.map +1 -1
- package/dist/utils/validation.d.ts +1 -1
- package/dist/utils/validation.js +39 -36
- package/dist/utils/validation.js.map +1 -1
- package/docs/README.md +6 -0
- package/docs/future-improvements.md +33 -0
- package/docs/migration-guide.md +160 -0
- package/docs/release-notes.md +89 -0
- package/package.json +5 -4
- /package/{HARDENING_SUMMARY.md → docs/hardening-summary.md} +0 -0
package/.mcp.json
CHANGED
|
@@ -1,41 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"mcpServers": {
|
|
3
|
-
"
|
|
4
|
-
"command": "
|
|
3
|
+
"quickbase": {
|
|
4
|
+
"command": "node",
|
|
5
5
|
"args": [
|
|
6
|
-
"-
|
|
7
|
-
"@modelcontextprotocol/server-github"
|
|
6
|
+
"/workspace/repos/mcp-quickbase/MCP-Quickbase/dist/mcp-stdio-server.js"
|
|
8
7
|
],
|
|
9
8
|
"env": {
|
|
10
|
-
"
|
|
9
|
+
"QUICKBASE_REALM_HOST": "team.quickbase.com",
|
|
10
|
+
"QUICKBASE_USER_TOKEN": "b4pekw_uyp_0_dzurqa6dx5jqgecnfgxavdcrfpqj",
|
|
11
|
+
"QUICKBASE_APP_ID": "buy74gngz"
|
|
11
12
|
}
|
|
12
|
-
},
|
|
13
|
-
"memory": {
|
|
14
|
-
"command": "docker",
|
|
15
|
-
"args": [
|
|
16
|
-
"run",
|
|
17
|
-
"-i",
|
|
18
|
-
"-v",
|
|
19
|
-
"claude-memory:/app/dist",
|
|
20
|
-
"--rm",
|
|
21
|
-
"mcp/memory"
|
|
22
|
-
]
|
|
23
|
-
},
|
|
24
|
-
"sequentialthinking": {
|
|
25
|
-
"command": "docker",
|
|
26
|
-
"args": [
|
|
27
|
-
"run",
|
|
28
|
-
"--rm",
|
|
29
|
-
"-i",
|
|
30
|
-
"mcp/sequentialthinking"
|
|
31
|
-
]
|
|
32
|
-
},
|
|
33
|
-
"context7": {
|
|
34
|
-
"command": "npx",
|
|
35
|
-
"args": [
|
|
36
|
-
"-y",
|
|
37
|
-
"@upstash/context7-mcp"
|
|
38
|
-
]
|
|
39
13
|
}
|
|
40
14
|
}
|
|
41
15
|
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Ticket: Relationship Management
|
|
2
|
+
|
|
3
|
+
**Ticket ID:** RELS
|
|
4
|
+
**Status:** Planning Complete
|
|
5
|
+
**Created:** 2025-12-28
|
|
6
|
+
|
|
7
|
+
## Summary
|
|
8
|
+
|
|
9
|
+
Implement full support for managing table-to-table relationships in the MCP Quickbase server. This includes four tools: `get_relationships`, `create_relationship`, `update_relationship`, and `delete_relationship`. Special attention is given to tool descriptions that clearly communicate destructive behavior to AI agents, ensuring they request user confirmation before performing irreversible operations.
|
|
10
|
+
|
|
11
|
+
## Problem Statement
|
|
12
|
+
|
|
13
|
+
The MCP Quickbase server currently lacks support for managing table-to-table relationships through the Quickbase API. Relationships are fundamental to Quickbase applications, enabling linked records, lookup fields (displaying parent data in child records), and summary fields (aggregating child data in parent records). Without this capability, agents cannot:
|
|
14
|
+
|
|
15
|
+
- Explore existing table structures and data connections
|
|
16
|
+
- Create new relationships when building applications
|
|
17
|
+
- Enhance relationships with additional calculated fields
|
|
18
|
+
- Remove relationships when refactoring applications
|
|
19
|
+
|
|
20
|
+
## Proposed Solution
|
|
21
|
+
|
|
22
|
+
Add a new `relationships` domain to the tools directory following existing patterns. Implement four tools mapping directly to the Quickbase Relationships API:
|
|
23
|
+
|
|
24
|
+
| Tool | Operation | Safety Level |
|
|
25
|
+
|------|-----------|--------------|
|
|
26
|
+
| `get_relationships` | List all relationships for a table | Safe (read-only) |
|
|
27
|
+
| `create_relationship` | Create new relationship with optional lookup/summary fields | Safe (creates new) |
|
|
28
|
+
| `update_relationship` | Add lookup/summary fields to existing relationship | Safe (additive only) |
|
|
29
|
+
| `delete_relationship` | Delete entire relationship including all lookup/summary fields | **DESTRUCTIVE** |
|
|
30
|
+
|
|
31
|
+
### Key Design Decisions
|
|
32
|
+
|
|
33
|
+
1. **Agent-Safety-First Descriptions**: Tool descriptions explicitly warn about destructive operations and recommend user confirmation
|
|
34
|
+
2. **Flat Parameter Structure**: Simple, snake_case parameters following existing conventions
|
|
35
|
+
3. **Separate Domain Directory**: `src/tools/relationships/` with domain index and individual tool files
|
|
36
|
+
|
|
37
|
+
## Relevant Agents
|
|
38
|
+
|
|
39
|
+
- **ticket-planner** (planning phase) - Completed
|
|
40
|
+
- **task-creator** (task generation) - Next step
|
|
41
|
+
- **implement-feature** (implementation) - Phases 1-3
|
|
42
|
+
- **verify-task** (verification) - Phase 4
|
|
43
|
+
- **commit-task** (commit) - Phase 4
|
|
44
|
+
|
|
45
|
+
## Deliverables
|
|
46
|
+
|
|
47
|
+
### Code Deliverables
|
|
48
|
+
|
|
49
|
+
- `src/tools/relationships/index.ts` - Domain registration
|
|
50
|
+
- `src/tools/relationships/get_relationships.ts` - GET tool
|
|
51
|
+
- `src/tools/relationships/create_relationship.ts` - POST tool
|
|
52
|
+
- `src/tools/relationships/update_relationship.ts` - POST tool (update)
|
|
53
|
+
- `src/tools/relationships/delete_relationship.ts` - DELETE tool
|
|
54
|
+
- `src/__tests__/tools/relationships.test.ts` - Unit tests
|
|
55
|
+
- Updated `src/tools/index.ts` - Registration integration
|
|
56
|
+
|
|
57
|
+
### Documentation Deliverables
|
|
58
|
+
|
|
59
|
+
Planning documents in [planning/](planning/):
|
|
60
|
+
- Comprehensive tool descriptions with safety warnings
|
|
61
|
+
- API endpoint mappings
|
|
62
|
+
- Type definitions
|
|
63
|
+
|
|
64
|
+
## Planning Documents
|
|
65
|
+
|
|
66
|
+
- [analysis.md](planning/analysis.md) - Problem analysis, API research, success criteria
|
|
67
|
+
- [architecture.md](planning/architecture.md) - Solution design, component interfaces, data flow
|
|
68
|
+
- [plan.md](planning/plan.md) - 4-phase execution plan with agent assignments
|
|
69
|
+
- [quality-strategy.md](planning/quality-strategy.md) - Testing approach, coverage requirements
|
|
70
|
+
- [security-review.md](planning/security-review.md) - Security assessment, destructive operation safeguards
|
|
71
|
+
|
|
72
|
+
## Phase Overview
|
|
73
|
+
|
|
74
|
+
| Phase | Objective | Tools |
|
|
75
|
+
|-------|-----------|-------|
|
|
76
|
+
| 1 | Foundation & Read Operations | `get_relationships` |
|
|
77
|
+
| 2 | Write Operations (Non-Destructive) | `create_relationship`, `update_relationship` |
|
|
78
|
+
| 3 | Destructive Operations with Safety | `delete_relationship` |
|
|
79
|
+
| 4 | Integration & Verification | All tools tested and registered |
|
|
80
|
+
|
|
81
|
+
## Tasks
|
|
82
|
+
|
|
83
|
+
See [tasks/](tasks/) for all ticket tasks (to be created by task-creator agent).
|
|
84
|
+
|
|
85
|
+
## API Reference
|
|
86
|
+
|
|
87
|
+
**Quickbase Relationships API Endpoints:**
|
|
88
|
+
|
|
89
|
+
| Method | Endpoint | Tool |
|
|
90
|
+
|--------|----------|------|
|
|
91
|
+
| GET | `/v1/tables/{tableId}/relationships` | `get_relationships` |
|
|
92
|
+
| POST | `/v1/tables/{tableId}/relationships` | `create_relationship` |
|
|
93
|
+
| POST | `/v1/tables/{tableId}/relationships/{relationshipId}` | `update_relationship` |
|
|
94
|
+
| DELETE | `/v1/tables/{tableId}/relationships/{relationshipId}` | `delete_relationship` |
|
|
95
|
+
|
|
96
|
+
## Next Step
|
|
97
|
+
|
|
98
|
+
**Recommended:** Run `/sdd:review RELS` to validate planning documents before creating tasks.
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# Analysis: Relationship Management
|
|
2
|
+
|
|
3
|
+
## Problem Definition
|
|
4
|
+
|
|
5
|
+
The MCP Quickbase server currently lacks support for managing table-to-table relationships through the Quickbase API. Relationships are a fundamental feature in Quickbase that allow linking records between tables, creating lookup fields (to display parent data in child records), and summary fields (to aggregate child data in parent records). Without relationship management capabilities, agents cannot:
|
|
6
|
+
|
|
7
|
+
1. Query existing relationships between tables
|
|
8
|
+
2. Create new relationships to link tables
|
|
9
|
+
3. Add lookup/summary fields to existing relationships
|
|
10
|
+
4. Delete relationships when no longer needed
|
|
11
|
+
|
|
12
|
+
This gap significantly limits the utility of the MCP server for database schema management and application configuration tasks.
|
|
13
|
+
|
|
14
|
+
## Context
|
|
15
|
+
|
|
16
|
+
### Why This Work Is Needed
|
|
17
|
+
|
|
18
|
+
Quickbase applications commonly have complex table structures with multiple relationships. Common use cases include:
|
|
19
|
+
|
|
20
|
+
- **Project Management**: Projects (parent) -> Tasks (child) with lookup fields for project name, summary fields for task counts
|
|
21
|
+
- **CRM**: Customers (parent) -> Orders (child) with summary fields for total revenue
|
|
22
|
+
- **Inventory**: Warehouses (parent) -> Products (child) with lookup fields for location info
|
|
23
|
+
|
|
24
|
+
Agents need to understand and modify these relationships to:
|
|
25
|
+
- Explore application schemas
|
|
26
|
+
- Create new tables with proper relationships
|
|
27
|
+
- Add calculated fields that span relationships
|
|
28
|
+
- Refactor application structure
|
|
29
|
+
|
|
30
|
+
### Quickbase Relationships API
|
|
31
|
+
|
|
32
|
+
The Quickbase RESTful API provides four endpoints for relationship management:
|
|
33
|
+
|
|
34
|
+
| Operation | Method | Endpoint | Description |
|
|
35
|
+
|-----------|--------|----------|-------------|
|
|
36
|
+
| Get Relationships | GET | `/v1/tables/{tableId}/relationships` | List all relationships for a table |
|
|
37
|
+
| Create Relationship | POST | `/v1/tables/{tableId}/relationships` | Create a new relationship with optional lookup/summary fields |
|
|
38
|
+
| Update Relationship | POST | `/v1/tables/{tableId}/relationships/{relationshipId}` | Add lookup/summary fields to existing relationship |
|
|
39
|
+
| Delete Relationship | DELETE | `/v1/tables/{tableId}/relationships/{relationshipId}` | Delete relationship and all associated lookup/summary fields |
|
|
40
|
+
|
|
41
|
+
## Existing Solutions
|
|
42
|
+
|
|
43
|
+
### Industry Patterns
|
|
44
|
+
|
|
45
|
+
Other database management tools handle relationships similarly:
|
|
46
|
+
- **Airtable API**: Provides link fields and rollup fields with similar semantics
|
|
47
|
+
- **Notion API**: Relations and rollups follow a comparable pattern
|
|
48
|
+
- **Microsoft Power Platform**: Dataverse relationships use similar parent-child paradigms
|
|
49
|
+
|
|
50
|
+
### Codebase Patterns
|
|
51
|
+
|
|
52
|
+
The existing codebase has established patterns for tool implementation:
|
|
53
|
+
|
|
54
|
+
1. **Tool Structure** (`src/tools/base.ts`):
|
|
55
|
+
- Tools extend `BaseTool<TParams, TResult>`
|
|
56
|
+
- Implement `name`, `description`, `paramSchema`, and `run()` method
|
|
57
|
+
- Use `QuickbaseClient` for API calls
|
|
58
|
+
|
|
59
|
+
2. **Domain Organization** (`src/tools/index.ts`):
|
|
60
|
+
- Tools grouped by domain (apps, tables, fields, records, files, reports)
|
|
61
|
+
- Each domain has `index.ts` with `register*Tools()` function
|
|
62
|
+
- Exports tool classes and registration function
|
|
63
|
+
|
|
64
|
+
3. **API Client Pattern** (`src/client/quickbase.ts`):
|
|
65
|
+
- Uses `request()` method with `RequestOptions`
|
|
66
|
+
- Supports GET, POST, PUT, DELETE, PATCH methods
|
|
67
|
+
- Automatic retry, caching (for GET), and rate limiting
|
|
68
|
+
|
|
69
|
+
4. **Type Definitions**:
|
|
70
|
+
- Interfaces for params and results defined in tool files
|
|
71
|
+
- JSON Schema for `paramSchema` used by MCP protocol
|
|
72
|
+
- Zod validation happens in base class
|
|
73
|
+
|
|
74
|
+
## Current State
|
|
75
|
+
|
|
76
|
+
The codebase currently supports:
|
|
77
|
+
- **Apps**: create, update, list tables
|
|
78
|
+
- **Tables**: create, update, get fields
|
|
79
|
+
- **Fields**: create, update
|
|
80
|
+
- **Records**: create, update, query, bulk operations
|
|
81
|
+
- **Files**: upload, download
|
|
82
|
+
- **Reports**: run
|
|
83
|
+
|
|
84
|
+
Relationships are **not** currently supported. The `getTableFields` tool returns field information but does not include relationship metadata.
|
|
85
|
+
|
|
86
|
+
## Research Findings
|
|
87
|
+
|
|
88
|
+
### API Response Structures
|
|
89
|
+
|
|
90
|
+
From the Quickbase API documentation (via Microsoft Learn connector reference):
|
|
91
|
+
|
|
92
|
+
**Relationship Object**:
|
|
93
|
+
```typescript
|
|
94
|
+
interface Relationship {
|
|
95
|
+
id: number; // Relationship ID (foreign key field ID)
|
|
96
|
+
parentTableId: string; // Parent table DBID
|
|
97
|
+
childTableId: string; // Child table DBID
|
|
98
|
+
foreignKeyField: { // Reference field in child table
|
|
99
|
+
id: number;
|
|
100
|
+
label: string;
|
|
101
|
+
type: string;
|
|
102
|
+
};
|
|
103
|
+
isCrossApp: boolean; // Whether cross-app relationship
|
|
104
|
+
lookupFields: Array<{ // Lookup fields from parent
|
|
105
|
+
id: number;
|
|
106
|
+
label: string;
|
|
107
|
+
type: string;
|
|
108
|
+
}>;
|
|
109
|
+
summaryFields: Array<{ // Summary fields in parent
|
|
110
|
+
id: number;
|
|
111
|
+
label: string;
|
|
112
|
+
type: string;
|
|
113
|
+
}>;
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Get Relationships Response**:
|
|
118
|
+
```typescript
|
|
119
|
+
interface GetRelationshipsResponse {
|
|
120
|
+
relationships: Relationship[];
|
|
121
|
+
metadata: {
|
|
122
|
+
skip: number;
|
|
123
|
+
totalRelationships: number;
|
|
124
|
+
numRelationships: number;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Destructive Operation Warning
|
|
130
|
+
|
|
131
|
+
**DELETE Relationship is highly destructive**:
|
|
132
|
+
- Deletes ALL lookup fields associated with the relationship
|
|
133
|
+
- Deletes ALL summary fields associated with the relationship
|
|
134
|
+
- Data in those fields is permanently lost
|
|
135
|
+
- The reference field itself is NOT deleted
|
|
136
|
+
- Cannot be undone
|
|
137
|
+
|
|
138
|
+
This is the most destructive operation in this feature set and requires special handling for agent safety.
|
|
139
|
+
|
|
140
|
+
### Key Constraints
|
|
141
|
+
|
|
142
|
+
1. **Same-App Only**: Relationships can only be created between tables in the same app (cross-app relationships are read-only)
|
|
143
|
+
2. **Reference Field Persistence**: The reference (foreign key) field remains after relationship deletion
|
|
144
|
+
3. **Additive Updates**: Updating relationships only adds fields; existing fields are not deleted
|
|
145
|
+
4. **Summary Field Complexity**: Summary fields require accumulation type (SUM, COUNT, AVG, MAX, MIN) and optional WHERE filter
|
|
146
|
+
|
|
147
|
+
## Constraints
|
|
148
|
+
|
|
149
|
+
### Technical Constraints
|
|
150
|
+
|
|
151
|
+
1. **Quickbase API Limits**: Standard rate limiting applies (handled by existing client)
|
|
152
|
+
2. **Table ID Required**: All operations require the child table ID
|
|
153
|
+
3. **Relationship ID**: Required for update/delete; equals the foreign key field ID
|
|
154
|
+
4. **Field Types**: Lookup/summary field types are determined by source fields
|
|
155
|
+
|
|
156
|
+
### Business Constraints
|
|
157
|
+
|
|
158
|
+
1. **Destructive Operations**: Must warn agents clearly about data loss
|
|
159
|
+
2. **User Confirmation**: Destructive operations should request user confirmation
|
|
160
|
+
3. **Consistency**: Must follow existing tool patterns and naming conventions
|
|
161
|
+
|
|
162
|
+
### Time Constraints
|
|
163
|
+
|
|
164
|
+
1. Focus on core CRUD operations first
|
|
165
|
+
2. Advanced features (cross-app relationship viewing) can be deferred
|
|
166
|
+
|
|
167
|
+
## Success Criteria
|
|
168
|
+
|
|
169
|
+
### Functional Requirements
|
|
170
|
+
|
|
171
|
+
- [ ] `get_relationships` tool lists all relationships for a table with complete metadata
|
|
172
|
+
- [ ] `create_relationship` tool creates relationships with optional lookup/summary fields
|
|
173
|
+
- [ ] `update_relationship` tool adds lookup/summary fields to existing relationships
|
|
174
|
+
- [ ] `delete_relationship` tool removes relationships with appropriate warnings
|
|
175
|
+
|
|
176
|
+
### Non-Functional Requirements
|
|
177
|
+
|
|
178
|
+
- [ ] Tool descriptions clearly indicate destructive operations
|
|
179
|
+
- [ ] Delete operation description strongly warns about data loss
|
|
180
|
+
- [ ] All tools follow existing codebase patterns (BaseTool, naming, types)
|
|
181
|
+
- [ ] Unit test coverage >= 35% (existing threshold)
|
|
182
|
+
- [ ] All tools include parameter validation via JSON Schema
|
|
183
|
+
- [ ] Error messages are actionable and specific
|
|
184
|
+
|
|
185
|
+
### Agent Safety Requirements
|
|
186
|
+
|
|
187
|
+
- [ ] Destructive tool descriptions include "DESTRUCTIVE" or "WARNING" labels
|
|
188
|
+
- [ ] Delete tool description explains exactly what will be lost
|
|
189
|
+
- [ ] Descriptions help agents understand when each tool is appropriate
|
|
190
|
+
- [ ] Create/Update operations clearly explain their non-destructive nature
|