Skip to main content

AI plugins

Extend the platform's AI assistant with custom tools and context providers.

What you'll learn​

  • The tool interface
  • Context providers
  • Manifest

The tool interface​

A tool is a typed function the assistant can call.

import { defineTool } from '@burdenoff/sdk-ai';

export const searchTickets = defineTool({
name: 'search_tickets',
description: 'Search the ticketing system for tickets matching a query',
parameters: {
query: { type: 'string', description: 'Search terms' },
status: { type: 'string', enum: ['open', 'closed', 'all'], default: 'open' },
},
handler: async ({ query, status }) => {
return await jira.search({ query, status });
},
});

Context providers​

A context provider supplies relevant background info to every assistant turn.

import { defineContextProvider } from '@burdenoff/sdk-ai';

export const currentSprintProvider = defineContextProvider({
name: 'current-sprint',
fetch: async (ctx) => {
const sprint = await jira.getCurrentSprint();
return `Current sprint: ${sprint.name}, ends ${sprint.endDate}`;
},
});

Manifest​

{
"name": "my-ai-plugin",
"type": "ai-plugin",
"tools": ["./tools/search-tickets.ts"],
"contextProviders": ["./context/current-sprint.ts"],
"requiredPermissions": ["read:integrations"]
}

Next steps​