Conversation
- P1: create metadata-report script and tool-metadata-audit utility; add pnpm dlx tsx invocation to package.json so pnpm metadata-report works - P2: resolve data dir relative to script file (cwd-independent); exit 1 on error instead of silently swallowing it - P2: gate page-size and sort dropdowns behind enableFilters; export filterTools with operations/behavior-flag filtering via options object; extract helpers to stay within complexity and param-count lint rules; add 13 tests covering the new filter paths - P2: export getSharedServiceDomain from toolkit-page (was internal); add 5 tests covering shared/mixed/empty/multi-domain edge cases - P3: fix telemetry page title typo (Telemtry -> Telemetry) Made-with: Cursor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
app/_components/toolkit-docs/components/available-tools-table.tsx
Outdated
Show resolved
Hide resolved
The prior commit added TOOL_METADATA_SERVICE_DOMAIN_STYLES, TOOL_METADATA_OPERATION_STYLES, and TOOL_METADATA_FALLBACK_STYLE imports to toolkit-page.tsx but the corresponding exports were never committed to constants.ts, breaking the Vercel build. Made-with: Cursor
- Add BehaviorFlagKey type export to types/index.ts (fixes Vercel build error: 'BehaviorFlagKey' not exported from types) - getSharedServiceDomain: add typeof string guard before accepting a serviceDomains entry; prevents TypeError if JSON has a non-string value calling .replace() on a Badge label (high severity) - matchesBehaviorFlags: skip entries where expected is undefined; with Partial<Record<BehaviorFlagKey, boolean>> a key can be undefined to mean "don't filter", but the old code compared !== expected which incorrectly excluded tools (low severity) Made-with: Cursor
|
|
||
| const behaviorRows = buildBehaviorRows(metadata.behavior); | ||
| const hasOperations = metadata.behavior.operations.length > 0; | ||
| const hasServiceDomains = metadata.classification.serviceDomains.length > 0; |
There was a problem hiding this comment.
ToolMetadataSection crashes on partial metadata
Low Severity
ToolMetadataSection accesses metadata.behavior and metadata.classification without optional chaining. If metadata exists but is partial (e.g. missing behavior or classification, or behavior.operations / classification.serviceDomains undefined), the component will throw at runtime.
| } from "../constants"; | ||
| import type { ToolMetadata, ToolMetadataBehavior } from "../types"; | ||
|
|
||
| type BehaviorFlagKey = "readOnly" | "destructive" | "idempotent" | "openWorld"; |
There was a problem hiding this comment.
Redundant BehaviorFlagKey type definition
Low Severity
BehaviorFlagKey is defined locally in tool-metadata-section.tsx but the same type is exported from types/index.ts. available-tools-table imports it from types. Duplicating the type risks drift if one definition is updated without the other.
Additional Locations (1)
| key={operation} | ||
| styles={TOOL_METADATA_OPERATION_STYLES} | ||
| value={operation} | ||
| /> |
There was a problem hiding this comment.
EnumBadge crashes on non-string enum values
Low Severity
EnumBadge receives operation and domain from metadata.behavior.operations and metadata.classification.serviceDomains and passes them to formatEnumLabel(value), which calls value.split("_"). If the JSON or API returns non-string values (e.g. numbers or null), a TypeError is thrown because non-strings have no split method.
Additional Locations (1)
This reverts commit 2c5b17a.
Reintroduce metadata filter controls for operations and behavior flags and wire them into tool filtering so metadata-based filtering appears and works in the available tools table. Made-with: Cursor
| return word.toLowerCase(); | ||
| }) | ||
| .join(" "); | ||
| } |
There was a problem hiding this comment.
Duplicated formatting function across two files
Low Severity
formatMetadataLabel in available-tools-table.tsx and formatEnumLabel in tool-metadata-section.tsx are identical implementations with different names. Both split on underscores, capitalize the first word, lowercase the rest, and special-case "crm". One shared utility would avoid divergence if the logic ever needs updating.
Additional Locations (1)
| destructive: "Destructive", | ||
| idempotent: "Idempotent", | ||
| openWorld: "Open world", | ||
| }; |
There was a problem hiding this comment.
Duplicated behavior label constants across two files
Low Severity
BEHAVIOR_FILTER_LABELS in available-tools-table.tsx and BEHAVIOR_LABELS in tool-metadata-section.tsx contain identical key-value mappings (e.g. readOnly → "Read only"). These are the same data under different names, creating a risk that a label change in one file isn't reflected in the other.
Additional Locations (1)
| export { | ||
| buildBehaviorRows, | ||
| ToolMetadataSection, | ||
| } from "./tool-metadata-section"; |
There was a problem hiding this comment.
Exported function unused outside its own module
Low Severity
buildBehaviorRows is exported from components/index.ts (and re-exported from the top-level barrel) but is never imported or used anywhere outside tool-metadata-section.tsx. This is dead exported surface area that adds unnecessary API breadth.
Group operations and behavior into a cleaner metadata filter row, keep boolean behavior filters as clickable chips with distinct Any/Yes/No styling, and stabilize the controls count area so toolbar layout doesn't shift as result totals change. Made-with: Cursor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| return word.toLowerCase(); | ||
| }) | ||
| .join(" "); | ||
| } |
There was a problem hiding this comment.
Identical formatting function duplicated across two new files
Low Severity
formatEnumLabel in tool-metadata-section.tsx and formatMetadataLabel in available-tools-table.tsx are identical implementations — same split-on-underscore logic, same special case for "crm", same title-casing. If either is updated (e.g., adding more acronym handling), the other risks becoming inconsistent. These belong in a shared utility.
Additional Locations (1)
| destructive: "Destructive", | ||
| idempotent: "Idempotent", | ||
| openWorld: "Open world", | ||
| }; |
There was a problem hiding this comment.
Behavior labels map and type duplicated across files
Low Severity
tool-metadata-section.tsx locally redefines the BehaviorFlagKey type (already exported from types/index.ts) and declares BEHAVIOR_LABELS — an identical copy of BEHAVIOR_FILTER_LABELS in available-tools-table.tsx. Both map the same four keys to the same four human-readable strings. These could be shared from a single source.


Note
Medium Risk
Updates the toolkit docs UI and filtering logic to incorporate per-tool metadata (operations/behavior/service domains), which could change table results and rendering when metadata is missing or malformed.
Overview
Surfaces static tool metadata in toolkit docs: each tool page now renders an "Execution hints" section showing operation/service-domain badges, MCP behavior flags, and expandable
extrasJSON when present.Enhances the Available tools table to support OAuth scope filters, sorting by scopes, and new metadata filters for
operationsplus tri-state behavior flags (Any/Yes/No);filterToolsis refactored to accept these options and is covered by new Vitest cases.Adds styling maps for metadata enums, shows a toolkit-level service-domain badge when all tools share a single domain, and introduces a
metadata-reportCLI (with audit utility) to summarize metadata coverage and distinct enum values.Written by Cursor Bugbot for commit 1894908. This will update automatically on new commits. Configure here.