Skip to main content
Glama
brilliantdirectories

brilliant-directories-mcp

Official

createTagRelationship

Attach an existing tag to a record by creating a tag relationship. Requires tag_id, object_id, tag_type_id, and added_by.

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): 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`.
added_byYes
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.
Behavior5/5

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

Discloses that the tool writes live data, warns about lack of uniqueness constraints causing duplicates, details the triple uniqueness check and filter-find pattern, and explains tag_type_id mapping via listTagTypes. This goes beyond annotations, which only provide hints.

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

Conciseness5/5

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

Well-organized with sections (Use when, Required, Pre-check, Parameter interactions, See also, tag_type_id mapping). Every sentence adds value, and the structure is front-loaded with purpose. No superfluous content.

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

Completeness4/5

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

Very thorough in usage, pre-checks, and parameter details, but does not explicitly describe the return value (e.g., created relationship ID or success). Given no output schema, a brief mention of output would enhance completeness.

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

Parameters5/5

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

Adds significant meaning beyond schema: explains tag_id is a stringified integer, clarifies added_by is required, and provides detailed mapping for object_id and tag_type_id with examples. Schema coverage is high but description enriches understanding.

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?

Description clearly states 'Create a tag relationship - Create a new tagrelationship record.' and distinguishes from siblings like createTag and updateTagRelationship, explicitly noting when to use this tool versus updateUser for member tags.

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 'Use when: attaching an existing tag to a record' and provides an alternative for members using updateUser. Also recommends pre-check for duplicates and references updateTagRelationship for modifications.

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