Skip to main content
Glama
ttpears

BookStack MCP Server

by ttpears

Get Recent Changes

get_recent_changes

Retrieve recently updated BookStack content with previews and change details to track documentation modifications.

Instructions

Get recently updated content with contextual previews and change descriptions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNoFilter by content typeall
limitNoNumber of recent items to return
daysNoNumber of days back to look for changes

Implementation Reference

  • The actual implementation of getRecentChanges, which builds the query and interacts with the BookStack API.
    async getRecentChanges(options?: {
      type?: 'all' | 'page' | 'book' | 'chapter';
      limit?: number;
      days?: number;
    }): Promise<any> {
      const limit = Math.min(options?.limit || 20, 100);
      const days = options?.days || 30;
      const type = options?.type || 'all';
      
      // Calculate date threshold
      const dateThreshold = new Date();
      dateThreshold.setDate(dateThreshold.getDate() - days);
      const dateFilter = dateThreshold.toISOString().split('T')[0]; // YYYY-MM-DD format
      
      // Build search query for recent changes
      let searchQuery = `{updated_at:>=${dateFilter}}`;
      if (type !== 'all') {
        searchQuery = `{type:${type}} ${searchQuery}`;
      }
      
      const params = {
        query: searchQuery,
        count: limit,
        sort: 'updated_at' // Sort by most recently updated
      };
      
      const response = await this.client.get('/search', { params });
      const results = response.data.data || response.data;
      
      // Enhance results with additional context
      const enhancedResults = await Promise.all(
        results.map(async (result: SearchResult) => {
          let contextualInfo = '';
          let contentPreview = result.preview_content?.content || '';
          
          try {
            // Get additional context based on content type
            if (result.type === 'page' && result.id) {
              const fullPage = await this.client.get(`/pages/${result.id}`);
              const pageData = fullPage.data;
              contentPreview = pageData.text?.substring(0, 200) || contentPreview;
              contextualInfo = `Updated in book: ${pageData.book?.name || 'Unknown Book'}`;
              if (pageData.chapter) {
                contextualInfo += `, chapter: ${pageData.chapter.name}`;
              }
            } else if (result.type === 'book' && result.id) {
  • src/index.ts:338-359 (registration)
    The registration of the 'get_recent_changes' MCP tool, including its schema and the handler that calls the client method.
    server.registerTool(
      "get_recent_changes",
      {
        title: "Get Recent Changes",
        description: "Get recently updated content with contextual previews and change descriptions",
        inputSchema: {
          type: z.enum(["all", "page", "book", "chapter"]).default("all").describe("Filter by content type"),
          limit: z.coerce.number().max(100).default(20).describe("Number of recent items to return"),
          days: z.coerce.number().default(30).describe("Number of days back to look for changes")
        }
      },
      async (args) => {
        const changes = await client.getRecentChanges({
          type: args.type,
          limit: args.limit,
          days: args.days
        });
        return {
          content: [{ type: "text", text: JSON.stringify(changes, null, 2) }]
        };
      }
    );
Behavior2/5

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

With no annotations provided, the description carries full burden but lacks behavioral details. It doesn't disclose permissions needed, rate limits, pagination behavior, or what 'contextual previews' and 'change descriptions' entail. The description is vague about operational traits.

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 a single, efficient sentence with zero waste. It's appropriately sized and front-loaded with the core purpose.

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

Completeness2/5

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

For a tool with no annotations and no output schema, the description is incomplete. It doesn't explain return values, error conditions, or behavioral constraints, leaving significant gaps for an AI agent to understand how to use it effectively.

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?

Schema description coverage is 100%, so the schema fully documents parameters. The description adds no parameter-specific information beyond implying filtering by content type and recency, which is already covered by the schema. Baseline 3 is appropriate when schema does the heavy lifting.

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 verb ('Get') and resource ('recently updated content') with additional features ('contextual previews and change descriptions'). It distinguishes from most siblings by focusing on recent changes rather than specific content retrieval or exports, though it doesn't explicitly differentiate from search tools.

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?

No guidance is provided on when to use this tool versus alternatives like search_content or get_pages. The description implies it's for recent changes but doesn't specify scenarios, prerequisites, or exclusions.

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/ttpears/bookstack-mcp'

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