# Tool tags

## What are tool tags?

Tags are short labels that group related tools, such as `billing`, `flags`, or `support`. When tag-based tool filtering is enabled on an MCP server, a client can connect to a focused subset of the server's tools by selecting one or more tags. See [tag-based tool filtering](/docs/ai-control-plane/distribute/mcp-servers/tool-filtering) for what tags enable and how the `tags` URL parameter works.

The Gram Functions Framework supports tags directly in tool definitions. Add tags to any tool using the top-level `tags` property:

```typescript

const gram = new Gram().tool({
  name: "create_invoice",
  description: "Create an invoice for a customer",
  tags: ["billing", "finance"],
  inputSchema: { customerId: z.string(), amount: z.number() },
  async execute(ctx, input) {
    const invoice = await createInvoice(input.customerId, input.amount);
    return ctx.json(invoice);
  },
});

```

Tags persist across deployments, so a tool keeps its tags when the function is rebuilt and pushed again.

## Tags and tag-based filtering

Tags defined on a Gram Function become the tool's source tags. They are available as filters once tag-based filtering is enabled on the MCP server, and they can be overridden from the dashboard.

A [tool variation](/docs/ai-control-plane/reference/concepts/tool-variations#tags) that sets tags replaces the tags defined here. See [tag-based tool filtering](/docs/ai-control-plane/distribute/mcp-servers/tool-filtering#effective-tag-precedence-rules) for the full precedence rules that decide which tags a tool is filtered by.

## Next steps

- Enable [tag-based tool filtering](/docs/ai-control-plane/distribute/mcp-servers/tool-filtering) on an MCP server.
- Override tags from the dashboard with [tool variations](/docs/ai-control-plane/reference/concepts/tool-variations#tags).
- Learn more about the [Functions Framework](/docs/ai-control-plane/connect/sources/gram-functions/functions-framework).
