Skip to main content
Glama
rspace-os

RSpace MCP Server

Official
by rspace-os

add_extra_fields_to_item

Extend inventory items with custom metadata fields for experiments or projects. Add text or numeric data to organize research information in RSpace.

Instructions

Adds custom metadata fields to inventory items

Usage: Extend items with experiment-specific or project-specific data Field format: [{"name": "Field Name", "type": "text|number", "content": "value"}] Types: 'text' for strings, 'number' for numeric values

Returns: Updated item with new custom fields

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
item_idYes
field_dataYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function decorated with @mcp.tool for registration. Processes list of dicts into ExtraField objects and adds them to the inventory item via inv_cli.
    @mcp.tool(tags={"rspace", "inventory", "utility"})
    def add_extra_fields_to_item(item_id: Union[int, str], field_data: List[dict]) -> dict:
        """
        Adds custom metadata fields to inventory items
        
        Usage: Extend items with experiment-specific or project-specific data
        Field format: [{"name": "Field Name", "type": "text|number", "content": "value"}]
        Types: 'text' for strings, 'number' for numeric values
        
        Returns: Updated item with new custom fields
        """
        extra_fields = []
        for field in field_data:
            field_type = i.ExtraFieldType.TEXT if field.get('type', 'text').lower() == 'text' else i.ExtraFieldType.NUMBER
            ef = i.ExtraField(field['name'], field_type, field.get('content', ''))
            extra_fields.append(ef)
        
        return inv_cli.add_extra_fields(item_id, *extra_fields)
  • Type hints and docstring define the input schema: item_id as int/str, field_data as List[dict] with name, type (text/number), content.
    def add_extra_fields_to_item(item_id: Union[int, str], field_data: List[dict]) -> dict:
        """
        Adds custom metadata fields to inventory items
        
        Usage: Extend items with experiment-specific or project-specific data
        Field format: [{"name": "Field Name", "type": "text|number", "content": "value"}]
        Types: 'text' for strings, 'number' for numeric values
        
        Returns: Updated item with new custom fields
        """
  • main.py:1131-1131 (registration)
    The @mcp.tool decorator automatically registers the tool with the MCP server.
    @mcp.tool(tags={"rspace", "inventory", "utility"})
Behavior3/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It indicates this is a mutation operation ('Adds', 'Returns: Updated item') and specifies the return format, which is helpful. However, it doesn't mention important behavioral aspects like whether this operation requires specific permissions, if it's idempotent, what happens when adding duplicate fields, or any rate limits - leaving significant gaps for a mutation tool.

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 appropriately sized and well-structured with clear sections: purpose statement, usage context, parameter format details, type explanations, and return information. Each sentence adds value, though the 'Usage:' label could be integrated more naturally into the flow rather than appearing as a separate section header.

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?

Given the tool's complexity (mutation operation with structured parameters), no annotations, and the presence of an output schema (which handles return value documentation), the description does a reasonably complete job. It covers purpose, usage context, parameter semantics, and return format. The main gap is the lack of behavioral constraints like permissions or side effects, which would be important for safe invocation.

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?

With 0% schema description coverage, the description must compensate for the schema's lack of documentation. It provides crucial semantic information about the 'field_data' parameter format, including the expected array structure with name, type, and content fields, and explains the type options ('text' for strings, 'number' for numeric values). However, it doesn't explain the 'item_id' parameter's dual integer/string format or provide examples of valid values.

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

Purpose4/5

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

The description clearly states the action ('Adds custom metadata fields') and resource ('inventory items'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'update_document' or 'tagDocumentOrNotebookEntry' that might also modify item metadata, leaving some ambiguity about when this specific tool is uniquely appropriate.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool ('Extend items with experiment-specific or project-specific data'), which helps the agent understand appropriate scenarios. However, it doesn't specify when NOT to use it or mention alternatives among the many sibling tools, particularly those that might handle metadata differently like 'update_document' or 'tagDocumentOrNotebookEntry'.

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/rspace-os/rspace-mcp'

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