@atlaskit/ads-mcp 1.7.4 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/dist/cjs/tools/get-all-components/components.codegen.js +2 -2
- package/dist/cjs/tools/search-tokens/list-search-tokens-tool.js +1 -1
- package/dist/cjs/tools/search-tokens/search-tokens-input-schema.js +2 -1
- package/dist/cjs/tools/search-tokens/search-tokens-tool.js +9 -6
- package/dist/es2019/tools/get-all-components/components.codegen.js +2 -2
- package/dist/es2019/tools/search-tokens/list-search-tokens-tool.js +1 -1
- package/dist/es2019/tools/search-tokens/search-tokens-input-schema.js +2 -1
- package/dist/es2019/tools/search-tokens/search-tokens-tool.js +6 -2
- package/dist/esm/tools/get-all-components/components.codegen.js +2 -2
- package/dist/esm/tools/search-tokens/list-search-tokens-tool.js +1 -1
- package/dist/esm/tools/search-tokens/search-tokens-input-schema.js +2 -1
- package/dist/esm/tools/search-tokens/search-tokens-tool.js +9 -4
- package/dist/types/tools/get-all-components/components.codegen.d.ts +1 -1
- package/dist/types/tools/search-tokens/search-tokens-input-schema.d.ts +3 -0
- package/dist/types/tools/search-tokens/search-tokens-tool.d.ts +1 -1
- package/package.json +2 -2
|
@@ -4,7 +4,7 @@ import { zodToJsonSchema } from '../../helpers/zod-to-json-schema';
|
|
|
4
4
|
import { searchTokensInputSchema } from './search-tokens-input-schema';
|
|
5
5
|
export const listSearchTokensTool = {
|
|
6
6
|
name: 'ads_search_tokens',
|
|
7
|
-
description: `Searches Atlassian Design System **design tokens** from bundled metadata. Returns JSON objects with **name** and **exampleValue** for each match (search also considers description, usage guidelines, and CSS property hints in metadata).
|
|
7
|
+
description: `Searches Atlassian Design System **design tokens** from bundled metadata. Returns compact JSON objects with **name** and **exampleValue** for each match by default (search also considers description, usage guidelines, and CSS property hints in metadata). Set **includeMetadata** to include usage guidelines in each result.
|
|
8
8
|
|
|
9
9
|
WHEN TO USE:
|
|
10
10
|
**Styling or theming in code**—you need the right \`token('…')\` names for colors, space, typography, etc. Use during layout and visual work when tokens must match ADS. Prefer \`ads_plan\` when you also need icons and components in the same step.
|
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
export const searchTokensInputSchema = z.object({
|
|
4
4
|
terms: z.array(z.string()).describe('Required: one or more terms; fuzzy match on token **name**, **description**, **exampleValue**, **usageGuidelines.usage**, and **usageGuidelines.cssProperties**. Example: `["spacing", "color.text", "background"]`.'),
|
|
5
|
-
limit: z.number().default(2).describe('Max matches **per term** (default 2).').optional()
|
|
5
|
+
limit: z.number().default(2).describe('Max matches **per term** (default 2).').optional(),
|
|
6
|
+
includeMetadata: z.boolean().default(false).describe('Include usage guidelines in each result (default false).').optional()
|
|
6
7
|
});
|
|
@@ -6,7 +6,8 @@ import { mergeMultiTermFuseResults } from '../../helpers';
|
|
|
6
6
|
import { cleanQuery } from '../../helpers/clean-query';
|
|
7
7
|
export const searchTokensTool = async ({
|
|
8
8
|
terms,
|
|
9
|
-
limit = 2
|
|
9
|
+
limit = 2,
|
|
10
|
+
includeMetadata = false
|
|
10
11
|
}) => {
|
|
11
12
|
// Unique cleaned terms (order preserved) so duplicates don't concatenate into a bogus query.
|
|
12
13
|
const searchTerms = [...new Set(terms.filter(Boolean).map(cleanQuery))];
|
|
@@ -54,7 +55,10 @@ export const searchTokensTool = async ({
|
|
|
54
55
|
});
|
|
55
56
|
const matchedTokens = matchedItems.map(item => ({
|
|
56
57
|
name: item.name,
|
|
57
|
-
exampleValue: item.exampleValue
|
|
58
|
+
exampleValue: item.exampleValue,
|
|
59
|
+
...(includeMetadata ? {
|
|
60
|
+
usageGuidelines: item.usageGuidelines
|
|
61
|
+
} : {})
|
|
58
62
|
}));
|
|
59
63
|
if (!matchedTokens.length) {
|
|
60
64
|
return {
|