Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Versioning](https://semver.org/spec/v2.0.0.html).
### Fixed

- Reject empty `parentRemId` values for `remnote_search` instead of treating them as unscoped search.
- Mark structured content node `children` arrays optional in `remnote_search` and `remnote_read_note` output schemas,
matching bridge responses that omit `children` for leaf nodes.

## [0.16.0] - 2026-06-05

Expand Down
9 changes: 5 additions & 4 deletions src/tools/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,12 @@ export const SEARCH_TOOL = {
},
children: {
type: 'array',
description: 'Nested child nodes (same shape recursively)',
description:
'Nested child nodes (same shape recursively; omitted for leaf nodes)',
items: { type: 'object' },
},
},
required: ['remId', 'title', 'headline', 'remType', 'children'],
required: ['remId', 'title', 'headline', 'remType'],
},
},
contentProperties: {
Expand Down Expand Up @@ -590,11 +591,11 @@ export const READ_NOTE_TOOL = {
},
children: {
type: 'array',
description: 'Nested child nodes (same shape recursively)',
description: 'Nested child nodes (same shape recursively; omitted for leaf nodes)',
items: { type: 'object' },
},
},
required: ['remId', 'title', 'headline', 'remType', 'children'],
required: ['remId', 'title', 'headline', 'remType'],
},
},
contentProperties: {
Expand Down
25 changes: 25 additions & 0 deletions test/unit/tools.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,31 @@ describe('Tool Definitions', () => {
expect(searchResultProps.contentStructured).toBeDefined();
});

it('should advertise structured child nodes with optional children arrays', () => {
const searchResultProps = ((
SEARCH_TOOL.outputSchema.properties.results as {
items?: { properties?: Record<string, unknown> };
}
).items?.properties ?? {}) as Record<string, unknown>;
const searchChildSchema = (
searchResultProps.contentStructured as {
items?: { properties?: Record<string, unknown>; required?: string[] };
}
).items;
const readProps = (READ_NOTE_TOOL.outputSchema.properties ?? {}) as Record<string, unknown>;
const readChildSchema = (
readProps.contentStructured as {
items?: { properties?: Record<string, unknown>; required?: string[] };
}
).items;

for (const schema of [searchChildSchema, readChildSchema]) {
expect(schema?.properties).toHaveProperty('children');
expect(schema?.required).toEqual(['remId', 'title', 'headline', 'remType']);
expect(schema?.required).not.toContain('children');
}
});

it('should advertise cursor paging for SEARCH_TOOL and SEARCH_BY_TAG_TOOL', () => {
const outputProps = SEARCH_TOOL.outputSchema.properties as Record<string, unknown>;
const searchByTagOutputProps = SEARCH_BY_TAG_TOOL.outputSchema.properties as Record<
Expand Down