Skip to content

Commit 541df2f

Browse files
committed
Added hints support to the landing + some minor fixes
1 parent 864adcc commit 541df2f

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Feat: `list_shared_projects` tool to fetch projects that user has permissions to collaborate on
66
- Feat: `reset_from_parent` tool to reset a branch from its parent's current state
7+
- Feat: `compare_database_schema` tool to compare the schema from the child branch and its parent
78

89
# [0.6.4] 2025-08-22
910

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ The Neon MCP Server provides the following actions, which are exposed as "tools"
198198
- **`list_branch_computes`**: Lists compute endpoints for a project or specific branch, including compute ID, type, size, and autoscaling information.
199199
- **`list_organizations`**: Lists all organizations that the current user has access to. Optionally filter by organization name or ID using the search parameter.
200200
- **`reset_from_parent`**: Resets the current branch to its parent's state, discarding local changes. Automatically preserves to backup if branch has children, or optionally preserve on request with a custom name.
201+
- **`compare_database_schema`**: Shows the schema diff between the child branch and its parent
201202

202203
**SQL Query Execution:**
203204

landing/components/DescriptionItem.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import {
1313
import {
1414
Terminal,
1515
CircleAlert,
16+
Lightbulb,
17+
BadgeInfo,
1618
Workflow,
1719
SquareArrowRight,
1820
Component,
@@ -30,6 +32,8 @@ const ALERT_VARIANT_PER_DESCRIPTION_TYPE: Record<
3032
next_steps: { variant: 'default', icon: SquareArrowRight },
3133
important_notes: { variant: 'important', icon: CircleAlert },
3234
workflow: { variant: 'default', icon: Workflow },
35+
hints: { variant: 'default', icon: BadgeInfo },
36+
hint: { variant: 'default', icon: Lightbulb },
3337
instructions: { variant: 'default', icon: Terminal },
3438
response_instructions: { variant: 'default', icon: Terminal },
3539
example: { variant: 'default', icon: Terminal },

landing/lib/description.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ const POSSIBLE_TYPES = [
1010
'example',
1111
'do_not_include',
1212
'error_handling',
13+
'hint',
14+
'hints',
1315
] as const;
1416

1517
export type DescriptionItemType = (typeof POSSIBLE_TYPES)[number];
@@ -134,7 +136,7 @@ export function parseDescription(description: string): DescriptionItem[] {
134136

135137
while (rest.length > 0) {
136138
const match = rest.match(
137-
/<(use_case|workflow|important_notes|next_steps|response_instructions|instructions|example|do_not_include|error_handling)>(.*?)<\/\1>/s,
139+
/<(use_case|workflow|important_notes|next_steps|response_instructions|instructions|example|do_not_include|error_handling|hints?)>(.*?)<\/\1>/s,
138140
);
139141

140142
if (!match) {

src/tools/definitions.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,8 @@ export const NEON_TOOLS = [
703703
\`\`\`
704704
</example>
705705
706+
There is an example of a case where the function is not deterministic and will have locks:
707+
706708
<example>
707709
\`\`\`sql
708710
-- Table rewrite, potentially longer lock time
@@ -712,9 +714,10 @@ export const NEON_TOOLS = [
712714
The fix for this is next:
713715
714716
\`\`\`sql
715-
-- Table rewrite, potentially longer lock time
717+
-- Adding a nullable column first
716718
ALTER TABLE users ADD COLUMN created_at timestamptz;
717719
720+
-- Setting the default value because the rows are updated
718721
UPDATE users SET created_at = now();
719722
\`\`\`
720723
</example>
@@ -730,9 +733,9 @@ export const NEON_TOOLS = [
730733
ALTER TABLE users ADD CONSTRAINT users_age_positive
731734
CHECK (age > 0) NOT VALID;
732735
733-
-- Step 2: Validate existing data (can take time but doesn't block writes)
734-
-- Uses SHARE UPDATE EXCLUSIVE lock - allows reads/writes
735-
ALTER TABLE users VALIDATE CONSTRAINT users_age_positive;
736+
-- Step 2: Validate existing data (can take time but doesn't block writes)
737+
-- Uses SHARE UPDATE EXCLUSIVE lock - allows reads/writes
738+
ALTER TABLE users VALIDATE CONSTRAINT users_age_positive;
736739
\`\`\`
737740
</example>
738741
@@ -812,7 +815,6 @@ export const NEON_TOOLS = [
812815
</example>
813816
814817
For PostgreSQL v18+
815-
<example>
816818
<example>
817819
\`\`\`sql
818820
-- Step 1: Adding a nullable column first
@@ -831,7 +833,6 @@ export const NEON_TOOLS = [
831833
ALTER TABLE users ALTER COLUMN created_at SET DEFAULT now();
832834
\`\`\`
833835
</example>
834-
</example>
835836
</hint>
836837
837838
<hint>

0 commit comments

Comments
 (0)