Skip to main content
Glama
marianfoo

SAP Documentation MCP Server

sap_community_search

Search SAP Community for blog posts, discussions, and solutions to troubleshoot technical issues using error codes and specific scenarios.

Instructions

SEARCH SAP COMMUNITY: sap_community_search(query="search terms")

FUNCTION NAME: sap_community_search (or mcp_sap-docs-remote_sap_community_search)

FINDS: Blog posts, discussions, solutions from SAP Community INCLUDES: Engagement data (kudos), ranked by "Best Match"

TYPICAL WORKFLOW:

  1. sap_community_search(query="your problem + error code")

  2. fetch(id="community-12345") for full posts

BEST FOR TROUBLESHOOTING: • Include error codes: "415 error", "500 error" • Be specific: "CAP action binary upload 415" • Use real scenarios: "wizard implementation issues"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch terms for SAP Community. Include error codes and specific technical details.

Implementation Reference

  • Registration of the sap_community_search tool including its name, detailed description, and input schema definition.
              {
                name: "sap_community_search", 
                description: `SEARCH SAP COMMUNITY: sap_community_search(query="search terms")
    
    FUNCTION NAME: sap_community_search (or mcp_sap-docs-remote_sap_community_search)
    
    FINDS: Blog posts, discussions, solutions from SAP Community
    INCLUDES: Engagement data (kudos), ranked by "Best Match"
    
    TYPICAL WORKFLOW:
    1. sap_community_search(query="your problem + error code")
    2. fetch(id="community-12345") for full posts
    
    BEST FOR TROUBLESHOOTING:
    • Include error codes: "415 error", "500 error"
    • Be specific: "CAP action binary upload 415"
    • Use real scenarios: "wizard implementation issues"`,
                inputSchema: {
                  type: "object",
                  properties: {
                    query: {
                      type: "string",
                      description: "Search terms for SAP Community. Include error codes and specific technical details.",
                      examples: [
                        "CAP action parameter binary file upload 415 error",
                        "wizard implementation best practices",
                        "fiori elements authentication",
                        "UI5 deployment issues",
                        "wdi5 test automation problems"
                      ]
                    }
                  },
                  required: ["query"]
                }
              },
  • Input schema definition for the sap_community_search tool, specifying the required 'query' parameter with description and examples.
    inputSchema: {
      type: "object",
      properties: {
        query: {
          type: "string",
          description: "Search terms for SAP Community. Include error codes and specific technical details.",
          examples: [
            "CAP action parameter binary file upload 415 error",
            "wizard implementation best practices",
            "fiori elements authentication",
            "UI5 deployment issues",
            "wdi5 test automation problems"
          ]
        }
      },
      required: ["query"]
    }
  • Core handler logic for executing sap_community_search: extracts query, calls searchCommunity helper, transforms results to standardized format, logs performance, handles errors and returns structured JSON response.
    if (name === "sap_community_search") {
      const { query } = args as { query: string };
      
      // Enhanced logging with timing
      const timing = logger.logToolStart(name, query, clientMetadata);
      
      try {
        const res: SearchResponse = await searchCommunity(query);
        
        if (!res.results.length) {
          logger.logToolSuccess(name, timing.requestId, timing.startTime, 0);
          return createErrorResponse(
            res.error || `No SAP Community posts found for "${query}". Try different keywords or check your connection.`,
            timing.requestId
          );
        }
        
        // Transform community search results to ChatGPT-compatible format
        const communityResults: SearchResult[] = res.results.map((r: any, index) => ({
          // ChatGPT-required format: id, title, url
          id: r.id || `community-${index}`,
          title: r.title || 'SAP Community Post',
          url: r.url || `#${r.id}`,
          // Additional fields for enhanced functionality
          library_id: r.library_id || `community-${index}`,
          topic: r.topic || '',
          snippet: r.snippet || (r.description ? r.description.substring(0, 200) + '...' : ''),
          score: r.score || 0,
          metadata: r.metadata || {
            source: 'sap-community',
            likes: r.likes,
            author: r.author,
            postTime: r.postTime,
            rank: index + 1
          }
        }));
        
        logger.logToolSuccess(name, timing.requestId, timing.startTime, res.results.length);
        
        return createSearchResponse(communityResults);
      } catch (error) {
        logger.logToolError(name, timing.requestId, timing.startTime, error);
        return createErrorResponse(
          `SAP Community search service temporarily unavailable. Please try again later.`,
          timing.requestId
        );
      }
    }
  • Helper function searchCommunity that performs the actual SAP Community search using searchAndGetTopPosts, fetches full post content, formats results with metadata (author, likes, tags), handles errors.
    export async function searchCommunity(query: string): Promise<SearchResponse> {
      try {
        // Use the convenience function to search and get top 3 posts with full content
        const result = await searchAndGetTopPosts(query, 3, {
          includeBlogs: true,
          userAgent: 'SAP-Docs-MCP/1.0'
        });
        
        if (result.search.length === 0) {
          return { 
            results: [], 
            error: `No SAP Community posts found for "${query}". Try different keywords or check your connection.` 
          };
        }
    
        // Format the results with full post content
        let response = `Found ${result.search.length} SAP Community posts for "${query}" with full content:\n\n`;
        response += `🌐 **SAP Community Posts with Full Content:**\n\n`;
    
        for (const searchResult of result.search) {
          const postContent = result.posts[searchResult.postId || ''];
          
          if (postContent) {
            // Add the full post content
            response += postContent + '\n\n';
            response += `---\n\n`;
          } else {
            // Fallback to search result info if full content not available
            const postDate = searchResult.published || 'Unknown';
            response += `### **${searchResult.title}**\n`;
            response += `**Posted:** ${postDate}\n`;
            response += `**Description:** ${searchResult.snippet || 'No description available'}\n`;
            response += `**URL:** ${searchResult.url}\n`;
            response += `**ID:** \`community-${searchResult.postId}\`\n\n`;
            response += `---\n\n`;
          }
        }
    
        response += `💡 **Note:** These results include the full content from ${Object.keys(result.posts).length} SAP Community posts, representing real-world developer experiences and solutions.`;
    
        return { 
          results: result.search.map((searchResult, index) => ({
            library_id: `community-${searchResult.postId || index}`,
            topic: '',
            id: `community-${searchResult.postId || index}`,
            title: searchResult.title,
            url: searchResult.url,
            snippet: searchResult.snippet || '',
            score: 0,
            metadata: {
              source: 'community',
              postTime: searchResult.published,
              author: searchResult.author,
              likes: searchResult.likes,
              tags: searchResult.tags,
              rank: index + 1
            }
          }))
        };
      } catch (error: any) {
        console.error("Error searching SAP Community:", error);
        return { 
          results: [], 
          error: `Error searching SAP Community: ${error?.message || 'Unknown error'}. Please try again later.` 
        };
      }
    } 
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: the tool searches SAP Community for content types (blog posts, discussions, solutions), includes engagement data (kudos), ranks results by 'Best Match', and is optimized for troubleshooting. However, it lacks details on rate limits, authentication needs, or pagination, which are common for search tools, leaving some gaps.

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

Conciseness3/5

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

The description is structured with clear sections (e.g., 'FINDS:', 'TYPICAL WORKFLOW:', 'BEST FOR TROUBLESHOOTING:'), which aids readability. However, it includes some redundant elements like repeating the function name and could be more streamlined. Every sentence adds value, but the formatting and repetition slightly reduce efficiency.

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

Completeness3/5

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

Given the complexity of a search tool with no annotations and no output schema, the description is moderately complete. It covers purpose, usage, and parameter guidance well, but lacks details on output format (e.g., result structure, pagination) and behavioral aspects like rate limits. For a tool with 1 parameter and 100% schema coverage, it's adequate but has clear gaps in contextual information.

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?

The input schema has 100% description coverage, with the 'query' parameter well-documented in the schema itself. The description adds meaningful context beyond the schema by emphasizing that queries should 'Include error codes and specific technical details' and providing a 'BEST FOR TROUBLESHOOTING' section with practical examples. This enhances understanding but doesn't fully compensate for the lack of output schema details.

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 explicitly states the tool's purpose: 'SEARCH SAP COMMUNITY' and specifies it 'FINDS: Blog posts, discussions, solutions from SAP Community.' It clearly distinguishes this from sibling tools like 'fetch' (which retrieves specific items), 'sap_help_search' (likely for SAP Help documentation), and 'search' (generic). The verb 'search' and resource 'SAP Community' are specific and unambiguous.

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?

The description provides explicit guidance on when to use this tool: 'BEST FOR TROUBLESHOOTING' with examples like including error codes and specific technical details. It also outlines a 'TYPICAL WORKFLOW' where this tool is used first for searching, followed by 'fetch' for detailed posts, clearly differentiating it from alternatives and specifying its role in a sequence.

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/marianfoo/mcp-sap-docs'

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