mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-30 19:35:36 +08:00
feat(Microsoft Excel SharePoint Node): Enable use as an AI agent tool (no-changelog) (#34592)
This commit is contained in:
@@ -41,6 +41,9 @@ export class MicrosoftExcelSharePoint implements INodeType {
|
||||
inputs: [NodeConnectionTypes.Main],
|
||||
outputs: [NodeConnectionTypes.Main],
|
||||
hidden: true,
|
||||
// The generated Tool variant inherits `hidden`, so both stay out of the
|
||||
// panel until launch; removing `hidden` exposes node and tool together.
|
||||
usableAsTool: true,
|
||||
// Legacy credentials deliberately excluded: the SharePoint one targets
|
||||
// the old _api host (not Graph); the Excel one has no Sites.* scopes.
|
||||
credentials: [
|
||||
|
||||
+20
-2
@@ -20,8 +20,26 @@ describe('MicrosoftExcelSharePoint (hidden shell)', () => {
|
||||
expect(node.description.displayName).not.toBe(oneDriveNode.description.displayName);
|
||||
});
|
||||
|
||||
it('should not be exposed as an AI tool yet', () => {
|
||||
it('should be exposed as an AI tool', () => {
|
||||
expect(node.description.version).toBe(1);
|
||||
expect(node.description.usableAsTool).toBeUndefined();
|
||||
expect(node.description.usableAsTool).toBe(true);
|
||||
});
|
||||
|
||||
it('describes every operation for a model choosing between tools', () => {
|
||||
const operationProperties = node.description.properties.filter(
|
||||
(property) => property.name === 'operation',
|
||||
);
|
||||
|
||||
expect(operationProperties.length).toBeGreaterThan(0);
|
||||
for (const property of operationProperties) {
|
||||
for (const option of property.options ?? []) {
|
||||
if (!('value' in option)) continue;
|
||||
expect(option.description, `operation ${String(option.value)}`).toMatch(/\w+/);
|
||||
expect(
|
||||
(option as { action?: string }).action,
|
||||
`operation ${String(option.value)} action`,
|
||||
).toMatch(/\w+/);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user