Skip to main content
Glama
MikelA92

Metabase MCP Server

by MikelA92

get_activity

Retrieve recent user activity feed from Metabase to monitor views, edits, and popular content through read-only access.

Instructions

📜 [SAFE] Get recent activity feed showing views, edits, and other actions in Metabase. Use this to see what users are doing or what content is popular. Risk: None - read-only operation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of activity items to return (default: 20)

Implementation Reference

  • The core handler function that implements the get_activity tool logic. It calls the Metabase /api/activity endpoint, formats the results into a readable text summary, and handles cases where the endpoint is unavailable (e.g., older Metabase versions).
      async getActivity(limit = 20) {
        Validators.validateLimit(limit, 1, 100);
        
        this.logger.debug('Getting activity', { limit });
        
        try {
          const activity = await this.apiClient.makeRequest(`/api/activity?limit=${limit}`);
          
          return {
            content: [
              {
                type: 'text',
                text: `Recent Activity (last ${limit} items):
    ${activity.map(a => 
      `- ${a.timestamp} | ${a.user?.common_name || 'Unknown'} | ${a.topic} | ${a.details}`
    ).join('\n')}`,
              },
            ],
          };
        } catch (error) {
          if (error.message.includes('404')) {
            return {
              content: [{ type: 'text', text: 'Activity endpoint not available in this Metabase version' }],
            };
          }
          throw error;
        }
      }
  • The tool definition including name, description, and input schema for 'get_activity', which specifies an optional integer 'limit' parameter between 1 and 100.
      name: 'get_activity',
      description: '📜 [SAFE] Get recent activity feed showing views, edits, and other actions in Metabase. Use this to see what users are doing or what content is popular. Risk: None - read-only operation.',
      inputSchema: {
        type: 'object',
        properties: {
          limit: {
            type: 'integer',
            description: 'Maximum number of activity items to return (default: 20)',
            minimum: 1,
            maximum: 100,
            default: 20,
          },
        },
      },
    },
  • Registration/dispatch in the MCP server's executeTool method switch statement, which maps the 'get_activity' tool call to the UserHandlers.getActivity handler.
    case 'get_activity':
      return await this.userHandlers.getActivity(args.limit);
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 adds context beyond what's in the schema: it explicitly states '[SAFE]' and 'Risk: None - read-only operation,' clarifying safety and read-only nature. It also hints at the tool's scope ('recent activity feed') and purpose ('see what users are doing or what content is popular'), though it lacks details on rate limits, pagination, or response format.

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 front-loaded, starting with an emoji and key safety info. It uses three sentences that each add value: stating the purpose, usage context, and risk assessment. There's minimal waste, though the emoji and bracketed '[SAFE]' could be seen as slightly informal, but they contribute to clarity.

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 tool's low complexity (1 parameter, no output schema, no annotations), the description is somewhat complete but has gaps. It covers purpose, usage, and safety well, but lacks details on output format (e.g., what the activity feed returns), pagination beyond the 'limit' parameter, or how 'recent' is defined. Without an output schema, more explanation of return values would be helpful for full completeness.

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?

The input schema has 1 parameter with 100% description coverage, providing details on 'limit' including type, range, and default. The description doesn't add any parameter-specific information beyond what the schema already covers. According to the rules, with high schema coverage (>80%), the baseline is 3 even with no param info in the description, which applies here.

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 tool's purpose: 'Get recent activity feed showing views, edits, and other actions in Metabase.' It specifies the verb ('Get') and resource ('activity feed'), and mentions the types of actions included. However, it doesn't explicitly differentiate from sibling tools like 'get_current_user' or other 'get_' tools that might also retrieve user-related data, keeping it from a perfect score.

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

Usage Guidelines3/5

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

The description provides some usage context: 'Use this to see what users are doing or what content is popular.' This implies when to use the tool (for monitoring activity or popularity), but it doesn't offer explicit guidance on when to choose this over alternatives like 'get_current_user' for user-specific data or other 'list_' tools for broader content. No exclusions or clear alternatives are mentioned.

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/MikelA92/metabase-mcp-mab'

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