Skip to main content
Glama
ilhankilic

YaparAI MCP Server

by ilhankilic

ai_reply_suggestion

Generates an AI-suggested reply for a social media conversation based on context. Customize tone and language with optional system prompts.

Instructions

Get an AI-generated reply suggestion for a social media conversation.

The AI reads the conversation context and suggests an appropriate reply. You can customize the AI behavior with a system prompt.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
conversation_idYesConversation ID to suggest a reply for
account_idYesSocial account ID
system_promptNoOptional custom instructions for the AI (e.g., "Reply politely in Turkish, offer 10% discount")
org_idNoOrganization ID (uses YAPARAI_ORG_ID env var if not provided)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the ai_reply_suggestion tool. Takes conversation_id, account_id, system_prompt, and optional org_id, resolves the org, creates a YaparAIClient, and calls social_ai_reply API.
    async def ai_reply_suggestion(
        conversation_id: str,
        account_id: str,
        system_prompt: str = "",
        org_id: str | None = None,
    ) -> dict:
        """
        Get an AI-generated reply suggestion for a social media conversation.
    
        The AI reads the conversation context and suggests an appropriate reply.
        You can customize the AI behavior with a system prompt.
    
        Args:
            conversation_id: Conversation ID to suggest a reply for
            account_id: Social account ID
            system_prompt: Optional custom instructions for the AI
                (e.g., "Reply politely in Turkish, offer 10% discount")
            org_id: Organization ID (uses YAPARAI_ORG_ID env var if not provided)
    
        Returns:
            Dict with suggested_reply text.
        """
        oid = resolve_org_id(org_id)
        client = YaparAIClient()
        return await client.social_ai_reply(oid, conversation_id, account_id, {
            "system_prompt": system_prompt,
        })
  • The client method social_ai_reply that sends a POST request to /api/enterprise/orgs/{org_id}/social/inbox/{conv_id}/ai-reply with account_id param and system_prompt in the JSON body.
    async def social_ai_reply(self, org_id: str, conv_id: str, account_id: str, payload: dict) -> dict:
        """Get AI reply suggestion."""
        return await self._request(
            "POST",
            f"/api/enterprise/orgs/{org_id}/social/inbox/{conv_id}/ai-reply",
            params={"account_id": account_id},
            json=payload,
        )
  • Import of ai_reply_suggestion from yaparai.tools.social on line 80.
        ai_reply_suggestion,
    )
  • Registration of ai_reply_suggestion as an MCP tool via mcp.tool(ai_reply_suggestion) on line 166.
    mcp.tool(ai_reply_suggestion)
  • Helper function resolve_org_id used by the handler to resolve the org_id from the parameter or YAPARAI_ORG_ID environment variable.
    def resolve_org_id(org_id: str | None = None) -> str:
        """Return the org_id from parameter or YAPARAI_ORG_ID env var.
    
        Raises ValueError if neither is set.
        """
        oid = org_id or YAPARAI_ORG_ID
        if not oid:
            raise ValueError(
                "Organization ID is required. Either pass org_id parameter "
                "or set the YAPARAI_ORG_ID environment variable. "
                "Use list_organizations() to find your org ID."
            )
        return oid
Behavior3/5

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

No annotations are provided, so the description bears full responsibility. It states the AI 'reads the conversation context and suggests an appropriate reply,' indicating a non-destructive read operation. However, it does not explicitly state that it does not modify anything, nor does it mention authorization requirements or rate limits. The description is reasonably transparent but could be more explicit.

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?

The description is three sentences long, front-loaded with the main purpose, and contains no redundant information. Every sentence adds necessary context: what the tool does, how it works, and customization option. Highly efficient.

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 presence of an output schema and 100% parameter coverage, the description covers the key functionality. It explains the tool's purpose and customization. However, it lacks mention of prerequisites (e.g., conversation must exist) or potential errors, which would make it fully complete. Still, for a straightforward suggestion tool, it is adequate.

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

Parameters3/5

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

Input schema coverage is 100%, so each parameter has a description in the schema. The tool description adds value by stating that the system prompt can customize behavior, which aligns with the schema. However, it does not provide additional semantic meaning beyond what the schema already conveys, such as the purpose of conversation_id and account_id. Baseline 3 is appropriate.

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 function: 'Get an AI-generated reply suggestion for a social media conversation.' The verb 'get' and resource 'reply suggestion' are specific, and it differentiates from siblings like 'generate_text' (general text) and 'reply_to_message' (manual reply) by focusing on AI-generated suggestions for social media.

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

Usage Guidelines2/5

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

The description does not provide explicit guidance on when to use this tool versus alternatives such as 'generate_text' or 'chat_with_bot'. It lacks when-not-to-use scenarios and does not mention prerequisites like conversation existence. The only hint is the mention of 'system prompt' customization, but no direct usage advice.

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/ilhankilic/yaparai-mcp'

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