Skip to main content
Glama
brilliantdirectories

brilliant-directories-mcp

Official

createTagRelationship

Attach an existing tag to a record (member, post, etc.) by creating a tag relationship. Ensure no duplicate link by checking uniqueness.

Instructions

Create a tag relationship - Create a new tagrelationship record. Writes live data.

Use when: attaching an existing tag to a record (member, post, etc.). The alternative for members is setting the member_tags field via updateUser with member_tag_action=1.

Required: tag_id, object_id, tag_type_id, added_by.

Pre-check before create (TRIPLE uniqueness): BD does NOT enforce uniqueness on the (tag_id, object_id, tag_type_id) triple. Attaching the same tag to the same object twice produces two rel_tag rows, which inflates tag counts on admin reports and can cause some widgets to render the same tag chip twice on the same record. Filter-find pattern (single-field server filter + client-side intersect - the server does not yet honor array-syntax multi-condition filters): call listTagRelationships property=tag_id property_value=<proposed tag_id> property_operator== to narrow to all rows for that tag, then CLIENT-SIDE filter to rows where object_id=<proposed object_id> AND tag_type_id=<proposed tag_type_id>. Zero results after client-side intersect = link free; >=1 = already attached. If the link already exists: skip the create (idempotent - the tag is already on the object). Never silently double-link.

Parameter interactions:

  • Attaches an existing tag to an existing record. Both sides must exist - use listTags and the target resource's list to discover IDs

See also: updateTagRelationship (modify existing).

tag_type_id + object_id - how to target the right record (from BD tag_types table):

The tag_type_id determines WHICH resource/table the object_id lives in. Discover mapping via listTagTypes - each tag type row has a table_relation field naming its target table. Example mapping:

tag_type_id

type_name

Target table (table_relation)

What object_id references

1

Users

users_data

user_id

(other rows)

(other types)

e.g. data_widgets, menus, forms

That table's primary key

Process: call listTagTypes first to see the tag_type_id -> table_relation mapping on your site, then pick the appropriate tag_type_id and supply the matching record's PK as object_id. Widgets, menus, and forms all support tags via the same tag_type_id + object_id lookup pattern.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tag_idYesInteger PK of the tag (`tags.id`) passed as a string per the underlying `varchar(500)` column. The schema column comment says "name of the tag" — that's legacy and misleading; BD stores the integer ID stringified. Discover via `listTags`.
object_idYesPrimary key of the record being tagged. Which table it lives in depends on tag_type_id - look up via listTagTypes. For tag_type_id=1 (Users), object_id is a user_id from users_data.
tag_type_idYesTag type classifier ID - determines which TABLE the `object_id` references. Call `listTagTypes` first to see the `tag_type_id` -> `table_relation` mapping. Example: `tag_type_id=1` usually means Users (`table_relation=users_data`), so `object_id` would be a `user_id`. Other tag types may target widgets, menus, forms.
added_byYes
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only indicate readOnlyHint=false, destructiveHint=false, idempotentHint=false, and openWorldHint=true. The description goes far beyond by disclosing that BD does not enforce uniqueness on the (tag_id, object_id, tag_type_id) triple, the risk of inflating tag counts and UI duplicates, and the filter-find pattern for pre-checks. It also warns that both tag and object must exist.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with sections (bold headers), bullet points, and a table, making it scannable. However, it is verbose and includes extensive detail that could be trimmed without losing clarity. The front-loaded purpose sentence is effective.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (4 parameters, no output schema, need for pre-check), the description covers purpose, when to use, prerequisites, uniqueness logic, parameter interactions, and cross-references to listTagTypes and updateTagRelationship. The mapping table for tag_type_id to target table adds critical context. There are no gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 75% (3 of 4 parameters described in schema). The description adds essential context: tag_id is an integer PK passed as string, object_id references different tables based on tag_type_id (with a mapping example), and tag_type_id requires calling listTagTypes. The added_by parameter lacks schema description but is mentioned as required; the description does not fully compensate but provides overall guidance.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Create a new tagrelationship record. Writes live data.' It specifies the action (create) and resource (tag relationship) and distinguishes from the alternative for members via updateUser with member_tag_action=1.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use: 'attaching an existing tag to a record (member, post, etc.)' and provides the alternative for members. Lists required parameters and includes a critical pre-check for uniqueness to avoid double-linking. References sibling tools like listTagRelationships and updateTagRelationship.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/brilliantdirectories/brilliant-directories-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server